Internationalization

From the 2.2.0 version of Noah, it is possible to use the multi-language feature. The 2.2.0 release contains a couple of languages for start, but the language files we use are mostly inherited from the old 1.3 version of Noah. Because the program has changed a lot since the 1.3, these old translations don't cover the 100% of all the current interface texts. Any contributions to extend or correct the existing translations, or create new ones are welcome!

Enabling the multi-language feature

The Settings form contains a new section called “Language properties”. It has three fields:

  • Default language: this is English by default, but you can select any other from the currently available languages,
  • Allow others to change language: if this is enabled, a selection drop down will be displayed on the pages that allows the immediate change of the program language for all the users,
  • Allowed languages to select from: setting the previous field only makes sense if you select here at least two languages

If you have enabled the feature, the language selector drop-down list will appear next to the theme selector. If a user changes the language, his or her selection will be stored in a cookie and this way, the program will “remember” that permanently.

The scope of the multi-language feature

What texts are actually affected when the feature is used:

  • Basically, all the interface texts: i.e. all the texts coming “from the program” (the texts which can be found in the language files),
  • The texts of some of the notification emails may also be affected (although, none of them are actually translated yet). E.g. if a German translation of the email_to_friend.html notification template file existed and someone switched to German and then used the “send to a friend” feature of an ad, the German version of the email would be sent to the friend.

The texts that are not affected by the feature:

  • Nothing that is coming from the database (i.e. none of the texts that either admin or any other users entered in any forms). E.g. the category names and descriptions, ad titles and descriptions, names of the ad fields, etc. will not change their language when one switches to an other language with the selector tool. 1)
  • Nothing that is written in a template file under the themes directory

Adding a new language to the program

You can add a new language to the program by creating new language files (or you can extend or correct the currently available languages by editing the current language files). All the language files can be found under the lang sub directory and every languages has two language files. E.g. you can find all the English texts in the lang_en.php and lang_admin_en.php files. The lang_admin_xx.php files contain texts that only appear on the admin interface. This separation aims to support the translators with providing the minimum set of texts in the separate lang_xx.php files that they must anyway translate to create a usable language version! As opposed to this, the lang_admin_xx.php files contain much more “advanced” texts, but these texts need not necessarily be translated, since they will be only ever seen by admin. (However, we would be glad if you translated them, too and we could provide full language support to the admin interface, as well!)

The process of creating a new translation is the following:

  • Create a copy of lang_en.php and lang_admin_en.php under the lang directory. Name the copies with the language code of the translation you are about to make. Use standard two letter codes, please. E.g. for an Esperanto translation, create lang_eo.php and lang_admin_eo.php.
  • Open the newly created language files in a text editor and translate them. A language item in the files looks like the following and the text you must translate is the one between the second pair of quotation marks:
$lll["categories"]="Categories";
  • You will find a block near the top of the lang_xx.php files where all the current languages are listed. Add there a new line with your newly created language. E.g.:
$lll["defaultLanguage_eo"]=$lll["allowedLanguages_eo"]="Esperanto";

(if you forget this, only the language code of your new translation will appear in the language selector drop-down lists)

The program will automatically detect that you created new language files and the new language will appear in the Settings form both in the Default language and in the Allowed languages to select from fields. Extend the Allowed languages to select from list with the new one to make it appear in the language selector. You can also establish translations of notification emails, too, by creating copies of the notification template files! You can find the notification templates under notifications. E.g. to create the Esperanto version of the email_to_friend.html template, make a copy of it into email_to_friend_eo.html and translate it!

Some important notes:

  • Noah's Classifieds uses the UTF-8 character set to save and display special characters found in many languages. If you make a translation of a file into a language that has special characters, save the language file with the UTF-8 character set! Most text editors support this - even Notepad does. Also, if you open an existing language file that contains spacial characters, open it as a UTF-8 file (or specify after the file open that your editor should treat it as UTF-8), so that your text editor can properly display all the characters.
1) The possibility of extending the scope of the multi-language feature on the database content might be considered for a future release!
 
translation.txt · Last modified: 2008/06/29 02:43 by admin
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki