top

Multilingual websites

With CMSimple_XH multilingual websites can be created. This means that the content of a website can be displayed in other languages by using a switcher. We will explain the standard procedure for this here. Please note the plugin recommendations at the very bottom of this page!

Create a new language

  1. Make a copy of the 2lang/ folder in the CMSimple_XH installation directory.
  2. Rename this to the two-character ISO 639-1 language code for the desired language.
    Example for Finnish: fi/
  3. Open the folder you just created. Inside it there is another folder content/
    Example: fi/content/
  4. Mark this folder and move(!) it to the folder content/ of your CMSimple_XH installation.
  5. Once there, rename the new folder back to the two-character language code.
    Example: content/fi/

For more languages, start again from 1.

Language menu

After (as described above) additional languages have been created, of course a possibility must be created to be able to switch to these languages. In most templates, such a language menu is already integrated. The code for the call of the language menu is in the template at the place where it should be given and looks like this:

<?php echo languagemenu();?>

Or the short version:

<?=languagemenu()?>

If such a call exists in the template and there are several languages, then several flags are displayed at the corresponding position. These flags should represent the respective languages. A click on them always leads to the start page of the respective language.

Recommendations

The flag solution is unfortunately not always very clear (for example: EN-GB / EN-US etc.). There are various solutions to get around this problem. In the forum you can find suggestions – for example here.

 

The LangMan_XH plugin simplifies the handling of languages in general and also offers alternative possibilities to the flagging issue.

 

The Polyglot_XH plugin provides additional options for managing multi-language websites. With the help of this plugin, it is also possible to direct the link target not to the respective home page when switching languages, but directly to the counterpart in the respective other language.

Templates

Templates are design patterns for websites that behave like masks. They determine the place where elements appear and influence their appearance.