Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gettext (i18n) and Smarty running erraticly

I'm developing a webapp with PHP and Smarty. I use gettext to internationalize, but I've a problem: it only works sometimes, absolutly randomly. I load a locale ('de_DE', by example) with putenv+setlocale+bindtextdomain+textdomain, reload the page, and see "Search"; reload again and I see "Suche"; two more reloads and get "Suche" but thirth give me "Search" again, then I see "Search" many time and suddenly I can see "Suche" again... randomly.

I've deactivated cache for Smarty, but same issue. I've configured Smarty to use different directories for different languages, templates_c/en_GB, templates_c/de_DE, and so on. Compiling works fine that manner.

I'm using smarty-gettext for templates translation.

Are there any known issue about using gettext and Smarty?

Edit to add some information: I'm running my tests in a Linux machine:

apache2 2.2.14

gettext 0.17

php 5.3.2

smarty 3-SVN$Rev: 3286

like image 841
ARemesal Avatar asked Nov 15 '22 07:11

ARemesal


1 Answers

Do you have Xcache or any other opcode cacher installed/enabled? Try disabling them.

like image 188
Kemal Avatar answered Dec 06 '22 06:12

Kemal