note 36823 added to ref.gettext
| From: | Danilo Segan | Date: | Thu, 23 Oct 2003 19:35:14 +0000 |
| Subject: | note 36823 added to ref.gettext | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-59184@lists.php.net to get a copy of this message | ||
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?
----
Manual Page -- http://www.php.net/manual/en/ref.gettext.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36823
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36823&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36823&report=yes
Search -- http://master.php.net/manage/user-notes.php