h2o-php icon indicating copy to clipboard operation
h2o-php copied to clipboard

Support non-standardized gettext implementations

Open speedmax opened this issue 14 years ago • 4 comments

Currently i18n only supports gettext native php extension, it is good but contains serious limitation on some deployment platform.

For instance apache1/2 caches translation mo file aggressively with no way to flush the gettext cache when apache is setup with mod_php, (php fastcgi is not affected)

Ideal gettext support

  • php-gettext php extension
  • php-gettext pure php library
  • other i18n implementation such as CakePHP I18n class

original LH ticket

This ticket has 0 attachment(s).

speedmax avatar Nov 04 '09 08:11 speedmax

Support non-standardized gettext implementations

by Taylor luk

speedmax avatar Nov 04 '09 08:11 speedmax

i18n is not working anymore, at least for me. I tried to solve it but I couldn't. First I used searchpath to set the path of the xgettext but it didn't work, so I used a symbolic link where the i18n.php for looking for. Then it only created a .pot file, but it fails with the .po. And the same thing using compile_message. And then, when I finally got the .pot and .mo file, I tried to set 'i18n'=>array('locale','es') and it didn't translate and did nothing.

So I think I'm just going to try with Django directly, and maybe the next time I try again with H2O. Thanks anyway!

hhkaos avatar Jun 10 '11 06:06 hhkaos

hhkaos: Make sure that you're setting the locale to one supported on your platform-- if you're on Ubuntu, you can check the list of supported locales in “/usr/share/i18n/SUPPORTED" and make sure that the locale you're specifying to H2o's i18n is generated in "/var/lib/locales/supported.d/local".

To generate new locales from the list of supported locales, just run sudo locale-gen en_US substituting en_US with whichever ES locale you'd like (options include things like es_ES, es_US, es_MX, etc-- but are always in the format language_COUNTRY).

Just to be clear-- the folders that you set up for the generated .po and .mo files need only match the language (so your folder can be named 'es'), but the locale you supply to H2o (and, by proxy, gettext) must always be one that your system supports, and must be specified completely with language.

coddingtonbear avatar Oct 25 '11 20:10 coddingtonbear

@latestrevision Big thanks for latestrevision for great explanation

speedmax avatar Oct 25 '11 22:10 speedmax