views:

878

answers:

2

I have a development version of my PHP website and when I moved it to my production server on centOS OS I discovered my locale version of en_EN is not working.

Could you please tell me what can cause that and what to do to get this working? I use setlocale and gettext to use i18n in PHP.

+2  A: 

I don't think en_EN is correct, Perhaps you mean en_US?

DGM
+2  A: 

I wouldn't recommend anyone using setlocale() and gettext() for localization in PHP (there are some serious issues that will drive any developer nuts). But anyway, there is no en_EN locale. The identifier before the underscore is the language (en = English), the identifier after the underscore is the country (EN = ???). You probably should be using en_US, en_GB, or something else.

Juliano
So what do you think is good to do for i18n in PHP?
tomaszs
Simple associative arrays works great. They are flexible, simple to understand, doesn't require an httpd restart to reload strings, etc. Complete it with classes to support plural inflection, date/time formatting, etc. Take a look at MediaWiki source code, and you will be enlightened.
Juliano