Localization of the Radicalendar
The Radicalendar has been completely rewritten to support full internationalization. After investigating a number of different methods for supporting multiple languages, it was decided that the GNU
gettext utility was the most mature, comprehensive method for offering localization options. PHP has internal functions to support gettext (though it must be compiled into PHP in advance), and this method permits the most unobtrusive method for internationalization that I've seen.
Calling gettext is almost as simple as an "echo" statement, using only a single character "
_" to call the function, so you have fully localized text with a simple statement like
echo _("This string is easy to display in any language");
Gettext works on as a simple hash table lookup, as do most internationalization hacks, but it provides several advantages:
- The base language text is still included in the source code, so the code remains relatively readable without needing to refer to the value of a variable like
- The translated localization files are compiled into machine-readable format for faster access.
- You're not storing a million variable names from a lookup file every time a page loads. There are 175+ strings of static text in the Radicalendar, which would make for an unwieldy variable file!
In addition to gettext translation of static strings, the entire Date class has been re-written to support localized Date and Time formats, so even calendar events and posting dates are displayed in local format. Pulldown menu with the names of months? Fully localized. It's cool.
Currently, the Radicalendar uses US English as its default language. Translators are desperately needed to provide translations for about 175 static text strings in the code. Don't be daunted by the quantity -- many of these strings are single words, plural versions of words, etc. There's some work to be done, but hey, you could have your translations appear around the world!
There is a new, online localization editor to make the process easier. If you feel qualified to offer your translation services, create a User account (if you don't have one already), send email to the webmaster here at the Radicalendar, and request permission for the localization editor. Please indicate the intended language of translation!
I'd like to offer support for any language currently supported by Linux installations, from the Indo-European languages to Greek, Turkish, Hebrew, Arabic, etc.
There are currently working translations in Spanish, Mexican Spanish, Portuguese, Brazilian Portuguese, Catalan, Norwegian, and Dutch. Unless you want to simply revise those translations, we do not need volunteers for translating them.
- Bear in mind the length of your translation, where you have some flexibility. Especially for things like button text, where the length of your translation will have a direct effect on the size of the button.
- The variations in static text in the Radicalendar have been condensed wherever possible, so that different pages often take advantage of the same strings. It is possible that you may find situations where this was possible for me to do in English, but it cannot be done in the language you are using, e.g. "Edit", which is both a verb ("to edit") and a noun ("I made an edit to my article"). I've tried to avoid this, but if you find such an instance, let me know at webmaster(at)radicalendar.org
- The manual for GNU gettext has tons and tons of information.
- If anything isn't clear, ASK!