note 36823 deleted from ref.gettext by vincent
| From: | vincent@php.net | Date: | Thu, 23 Oct 2003 20:58:30 +0000 |
| Subject: | note 36823 deleted from ref.gettext by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59190@lists.php.net to get a copy of this message | ||
Note Submitter: Danilo Segan <danilo WHO kvota WHAT net>
----
If you want gettext functionallity, but don't have root access to the machine (to add locales
and stuff), you might want to check my PHP-gettext package: you don't need any of setlocale(),
binddomain() and similar functions.
It allows reading MO files directly, and provides interface equivalent to gettext() and ngettext()
function calls. This means that you have to do the administrativia (eg. create an array of existing
translations, and load file $translation[$language] afterwards).
Check a short description at: http://danilosegan.com/blog/ihatephp/php-and-gettext-playing-nicely
If you don't want to read that, grab the 13kb tarball from http://kvota.net/hacks/php-gettext/php-gettext-1.0.1.tar.gz
I'll do a new release in a couple of days to add caching of translations (it's trivial to
do, just check the translate() and ngettext() functions in gettext_reader class).
Of course, any comments on my crappy PHP code are welcome -- I'm used to the delightful syntax
of Python, so don't blame me for not knowing any better ;-)
Would anyone consider adding similar functionallity to official PHP distribution?