You are here: start » other_languages

Other Languages

Localization

CMSimple_XH is fully internationalized, i.e. all strings that are emitted can be customized according to the language. This mainly concerns output in the back-end, but also e.g. the titles of the sitemap and mailform.

Several localizations are available for download as Language Packs. In versions before CMSimple_XH 1.5 all available localizations were already shipped with the base distribution.

If your desired language is missing, you might consider to provide your own translation. This is pretty easy. Go to the folder cmsimple/languages, make a copy of the language files you want to translate and rename them to the new language. E.g. if you want to translate from English to Portuguese, you have to rename en.php to pt.php and enconfig.php to ptconfig.php. Then log in to your CMSimple_XH installation and go to Settings→Language. Here you can translate all fields to your language. Don't forget to save your translations. Then navigate to Settings→Website and translate these fields also (what is necessary only for CMSimple_XH < 1.6).

For multilingual websites or contribution only: finally you have to add a language icon, i.e. a flag in GIF format, if it's not already there. Put it into the folder images/flags with the proper name, e.g. pt.gif. Its size should be 18×12 px.

The localization of plugins is similar. The files are usually stored in the languages/ folder of the plugin and usually you can translate them in the plugin administration under “(Plugin) Language”.

If you have to translate more than a few language strings you may consider using Translator_XH.

If you like to contribute your translation have a look at the CMSimple Forum.

Multilingual Websites

CMSimple_XH can be used for multilingual (multilanguage) websites. Just make a copy of the folder 2lang/ in the CMSimple_XH root directory, and rename it to the ISO 639-1 two-letter language code for the desired language. Since CMSimple_XH 1.6 you have to additionally move the subfolder content/ of the new folder to the content/ folder in the installation folder, and rename it to the respective language code. FIXME1). If you need further languages, just repeat this procedure for all the languages.

If your template calls languagemenu() the multilingual website will already work. Otherwise you have to insert

<?php echo languagemenu(); ?>

into your template at the place where the language menu should be displayed. The language menu displays flags that link to the respective content. The flag icons are stored in images/flags/ (CMSimple_XH < 1.6) resp. userfiles/images/flags (CMSimple_XH ≥ 1.6). If a required flag icon is missing you can add it yourself; otherwise the language code is shown instead of a flag.

Note: the contents of the different languages are independent of each other. So basically it's possible to have totally different contents for each language. IOW: if you want to have a one-to-one translation of the content, you have to take care for it yourself. As an aid you can use the Multilang_XH plugin (this plugin is not compatible with CMSimple_XH ≥ 1.6). This allows to connect the pages to their according translations, and provides an overview which pages are already translated, and which are not. The plugin Polyglott_XH is a CMSimple_XH 1.6 compatible successor of Multilang_XH.

Language defaults

From CMSimple_XH 1.5 upwards, there's the concept of language defaults. This is primarily done to ease the update of CMSimple_XH's core and conforming plugins. For example, let's say you have plugin xyz version 1.0 installed and already adjusted en.php to your needs. Now xyz version 1.1 is available, and you want to update to the newest version. So conduct the update to version 1.1 as usual, and afterwards copy your “old” en.php to the languages/ folder. Then login to CMSimple_XH and switch to plugin Xyz → Plugin language. You'll see your “old” en.php plus the new language strings from default.php. For example, your “old” en.php is:

$plugin_tx['xyz']['1st_string']="first";
$plugin_tx['xyz']['2nd_string']="second";

and default.php is:

$plugin_tx['xyz']['1st_string']="1st";
$plugin_tx['xyz']['2nd_string']="2nd";
$plugin_tx['xyz']['3rd_string']="3rd";

So in the back-end you'll see:

$plugin_tx['xyz']['1st_string']="first";
$plugin_tx['xyz']['2nd_string']="second";
$plugin_tx['xyz']['3rd_string']="3rd";

This should make it easier to translate new language strings, after you've already translated (or adjusted) the existing language strings of an earlier version. Just translate (or modify according to your needs) the new language strings and save them. From now on you'll be presented the new localization of the language strings.

1)
needs better explanation
 
You are here: start » other_languages
Except where otherwise noted, content on this wiki is licensed under the following license: GNU Free Documentation License 1.3
Valid XHTML 1.0 Valid CSS Driven by DokuWiki