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!
The Settings form contains a new section called “Language properties”. It has three fields:
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.
What texts are actually affected when the feature is used:
The texts that are not affected by the feature:
In the 3.1.0 release, however, we have added a workaround that still makes it possible to internationalize the part of the database content that is set up by the administrator! E.g. category names and descriptions, custom field names, explanation texts, etc. Details are below.
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:
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.$lll["categories"]="Categories";
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:
$langDir="rtl";
From the 3.1.0 version, it is possible to internationalize the template files, too. You have two choices here and the decision mainly depends on the amount of language texts in the given template file:
1. If a template file contains only a few language texts (the rest of the file is mostly just HTML), it makes sense that you do the translation “inline”
If you have a sentence in the template file say “Our customer support is very friendly”, replace it with the following Php code:
<?php echo $this->addLangText("friendlySupport") ?>
Then insert the following into one of the language files - e.g. if you want that the sentence is displayed in German than into 'lang_de.php':
$lll["friendlySupport"]="However you translate it into German.";
2. If a template file contains long language texts and fewer HTML, you can make different language versions from the template file
E.g. if you have a template file called 'faq.tpl.php' that contains the FAQ text in your default language, but you want to maintain a German version of the FAQ page, too, create a file called 'faq_de.tpl.php' in the same template directory. Translate its content and it will be chosen by the program automatically as the template of the FAQ page when one views the page in German.
From 3.1.0, it is possible to translate even some of the texts that has been written into the database. This only includes the texts that the administrator can set up in the program - e.g. the categories, custom fields, settings, notifications and custom lists. So that this works, you must create a third language file called 'lang_custom_xx.php' in the 'lang' directory (where 'xx' replaces the country code of the language). The content of this new language file will be analogue to the two old language files. For an example, see the 'lang_custom_hu.php.example' file in the latest update!
<?php // You can use a file like this to provide translations of texts that are stored in the database. // Categories: // e.g. $lll[1]["category"]["name"] identifies the 'Name' field of the category object with ID 1. $lll[1]["category"]["name"]="Autók"; $lll[1]["category"]["description"]="Egy csomó külonbozõ típusú autó"; $lll[1]["category"]["customAdListTitle"]="Sajat egyedi cim"; $lll[2]["category"]["name"]="Hardver"; $lll[2]["category"]["description"]="Itt alkatrészeket találhat számítógépébe"; $lll[2]["category"]["customItemListTitle"]=""; // ... // Custom fields: // e.g. $lll[1]["field"]["name"] identifies the 'Name' property of the custom field object with ID 1. $lll[45]["customfield"]["name"]="Fogyasztas"; $lll[45]["customfield"]["expl"]="Magyarázó szöveg"; // the 'Explanation text' property $lll[45]["customfield"]["default_text"]="ketto"; // the 'Default' property of the Text and Selection fields $lll[45]["customfield"]["default_multiple"]="ketto"; // the 'Default' property of the Multiple selection and Checkbox fields $lll[45]["customfield"]["formatPrefix"]="prefiksz"; // the 'Prefix' property $lll[45]["customfield"]["formatPostfix"]="posztfiksz"; // the 'Postfix' property $lll[45]["customfield"]["precisionSeparator"]="prec"; // the 'Precision separator' property $lll[45]["customfield"]["thousandsSeparator"]="thou"; // the 'Thousands separator' property $lll[45]["customfield"]["format"]="format %s"; // the 'Display format' property $lll[187]["customfield"]["name"]="Promocios szint"; $lll[187]["customfield"]["values"]="semmi, arany, ezust, bronz"; // the 'Possible values' property $lll[186]["customfield"]["name"]="Promocios szint"; $lll[186]["customfield"]["values"]="semmi, arany, ezust, bronz"; // the 'Possible values' property // ... // Custom lists // e.g. $lll[1]["customlist"]["listTitle"] identifies the 'Title' property of the custom list object with ID 1. $lll[1]["search"]["listDescription"]="Hirdeteseim"; // the 'Description' property $lll[1]["search"]["listTitle"]="Hirdeteseim"; $lll[2]["search"]["listDescription"]="A 100 legfrissebb hirdetes"; // the 'Description' property $lll[2]["search"]["listTitle"]="Legfrissebb"; $lll[3]["search"]["listDescription"]="A 100 legnezettebb hirdetes";// the 'Description' property $lll[3]["search"]["listTitle"]="Nepszeruk"; // ... // Settings // e.g. $lll[1]["settings"]["titlePrefix"] identifies the 'Title prefix' property of the settings object. $lll[1]["settings"]["titlePrefix"]="Magyar cim - "; $lll[1]["settings"]["mainTitle"]="Cim"; // the 'Title tag' property $lll[1]["settings"]["mainDescription"]="Leiras"; // the 'Description meta tag' property $lll[1]["settings"]["mainKeyword"]="kulcsszo1, kulcsszo2"; // the 'Keywords meta tag' property $lll[1]["settings"]["dateFormat"]="m-d-Y"; // the 'Date format' property // Notifications // e.g. $lll[1]["notification"]["title"] identifies the 'Title' property of the notification object with ID 1. $lll[1]["notification"]["title"]="Regisztracios email"; $lll[1]["notification"]["subject"]="Regisztracios email"; // the 'Subject' property $lll[1]["notification"]["body"]="Magyar nyelvu email szoveg"; // the 'Body' property ?>
Some notes on this:
$lll["friendlySupport"]="However you translate it into German.";
It makes sense that you put them just into the 'lang_custom_xx.php'! You don't have to care about merging your additions again into the language file after every updates.