Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for externalizing strings in PHP

I've been surprised by how little I've found on externalizing strings in PHP. Does everyone use gettext, or is there some other framework or tool that I'm not aware of?

like image 846
BenV Avatar asked Jun 26 '26 07:06

BenV


2 Answers

Zend_Translate / Zend_Locale are nice and very flexible. They do not need the whole Zend Framework to be present. They support gettext moo/.po files but also CSV and other formats.

like image 83
Pekka Avatar answered Jun 28 '26 01:06

Pekka


Hope this library helps you:

The i18n package is a punch of classes for internationalization. It gives you the possibility to maintain multilanguage webpages more easily. The translation strings are stored in flat text files, special Gettext files which are basically precompiled translation files or in a MySQL database. And it works independently from PHP’s setlocale function.

like image 32
SDReyes Avatar answered Jun 28 '26 01:06

SDReyes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!