[translations] Locale support for the installer (with patch)

Gabor Hojtsy gabor at hojtsy.hu
Tue Aug 1 12:20:41 UTC 2006


Hi,

   http://drupal.org/node/76555

We discussed providing locale support for the installer. Here is a patch, 
which works for me, but obviously needs some discussion. What did I do to 
support a locale in the installer:

* Wrapped all strings in the installer files in st() calls. Some having 
placeholder text were already wrapped.
* Made possible to run the PO import in installer mode. Theme() and t() 
are not defined in this mode, so setting of error messages need to be 
dealt with as a special case for normal operation and for the installer.
* The PO import in installer mode is only interested in st() calls now (no 
format_plural support). This does not seem to be a problem yet, since 
format_plural() is not needed in the installer. * In installer mode, the 
strings are stored in an array and retrieved from the st() function.
* The tricky part is indentifying the locale to use. I stepped this over 
for now. The installer tries to read an installer.po file from a folder 
named 'locale'. If it does not exist, English is used; if it does exist, 
the translations in this file are used. There is no support for installer 
language selection in this patch. First I would like to discuss the 
approach taken here before stepping further.

I have already updated the extractor.php script to handle st() functions, 
and generate an installer.pot file with all the st() wrapped strings found 
throughout core, regardless where they are. This enables translation teams 
to provide that installer.po file st() is trying to look for.

Comment on the issue please!

Gabor


More information about the translations mailing list