Internationalization

Internationalization is done with a GNU gettext approach, but without requiring PHP gettext extension. This approach is more comfortable than others for many reasons, but it is advised to keep messages as coherent as possible and to reuse _exactly_ the same message where appropriate. As nobody could have such strong memory there is a search function in the language support area where a programmer could look for reusable messages.

All the programmer should know is that every message to be internationalized in the core Obliquid should be in English and has to be passed to _l() function. On the other hand any internationalization occouring in local directory could be done with any language of choice as a base language. In any case, no message should be written directly into the template but always passed through templates variables from PHP script.

Translators will have to translate a text file in PO gettext format, like the one in this example: Italian common PO file found in common/locale/it_IT/obliquid_utf-8.po. The file has to be saved in UTF-8 format and it can be done with a text editor, by changing only the msgstr part of the file. There are also good tools that make the tranlation work easier, expecially when some of the messages were modified and a second translation has to occour. In this case all the message translations that didn't change won't be lost, but messages, even slightly changed needs to be fixed. Gettext tools make an attempt to find a similar message and suggest the translation in those cases, the message will be marked as fuzzy, that means that a human translator have to review and fix it.

Example PHP script

  //defines a few messages
  $msg["alert"]=_l("Pay attention please");
  $msg["other"]=_l("Just another message");

  //passes them to the slot template
  $_obweb->smslot->assign("msg", $msg);
Example Smarty template

<span class="titlebig">{{$msg.alert}}</span><br>
<span class="textstandard">{{$msg.other}}</span>

A free text editor that supports UTF-8 encoding is SciTE. This editor works both on Linux/Unix and on Windows Operative systems. I personally use KBabel that is a specialized tool for PO files, working only on Linux afaik. poedit works on both Windows and Linux and should do the job with PO files, but I didn't try it yet.