tags:

views:

306

answers:

1
+1  A: 

Did you hear right? As far as I know, you do need system locales for gettext to work. However, you do not need to install all the translations for those system locales just to make your "hello world" work.

Sander Marechal
You could be right in that. Is there a way to install locales as normal user?
Masse
Not that I know of. It depends on your Linux distribution I suppose but I think they all require root access to generate the locales. That means that someone using your CMS must ask their sysadmin to generate the proper locales.This requirement for system locales is quite annoying in a web environment where you want to provide your website in a couple of dozen languages. That is probably also why most web frameworks don't use gettext but something like ICU or a custom library that functions like gettext but doesn't depend on it.
Sander Marechal
Hmm... Apparently Django is using gettext for translations, as well as PHP, and they seem to be succeeding in it.
Masse
circir: Django does not use gettext for the actual tanslation lookups. It uses it's own internal functions that mimic gettext but do not require system locales to be installed. Django does use some of the gettext binaries to extract translatable strings from source code and to compile .po files, but these operations do not require system locales to be installed.PHP's gettext system does use the real gettext and as such does require system locales installed. That's one of the reasons so few projects use PHP gettext and prefer their own i18n system.
Sander Marechal