Multisite Localization


This article is obsolete and may be not valid anymore!

1. How to translate Multisite into other languages

The Check_MK Multisite GUI is shipped with all texts in English language. Currently no other languages are provided - but - Multisite is already internationalized (i18n'ed). This means that all steps neccessary for localization into other languages are already done. So creating a new language support for Multisite is fairly easy.

Multisite is using GNU gettext - the defacto standard for i18n in Open Source software. If you are familiar with gettext then you'll find it easy to create a localization of Multisite. Please refer to the internet for documentation about gettext.

Check_MK provides a convenient interface for translators. Call cmk --localize for a short help (when using OMD do this as site user):

OMD[mysite]:~$ cmk --localize
Usage: check_mk [-v] --localize COMMAND [ARGS]

Available commands are:
   update  LANG     ...  Creates or updates a .po file for the given language.
   compile LANG     ...  Compiles the .po file into a .mo file which can
                         be used by gettext.
   edit    LANG     ...  Call update, open .po in editor and compile in one step

  The regular process for translating is:

  1.) Create/update the .po file for the given language
  2.) Edit the .po file
  3.) Compile the .po file to get a .mo file which can be used by gettext

  Locale files are located in: /omd/sites/walks/local/share/check_mk/locale

The first step is to choose a language code for your language. Let's take de for German as an example. Also please make sure that GNU gettext is installed on your system.

Now you let Check_MK create a .po file containing all messages to be translated in your current version:

OMD[mysite]:~$ cmk --localize update de

Please ignore warnings from gettext at this stage. If everying has run successfully then the following message must be printed:

Success! Output: /omd/sites/mysite/local/share/check_mk/locale/de/LC_MESSAGES/multisite.po

Now use an arbitrary text editor or some gettext-GUI of your choice in order to edit the .po file. After you have finished, compile your translations into a byte-optimized machine-readable file for gettext:

OMD[mysite]:~$ cmk --localize compile de
Success! Output: /omd/sites/mysite/local/share/check_mk/locale/de/LC_MESSAGES/multisite.mo

After this you need to restart your Apache webserver in order to make the changes active. OMD users do this by:

OMD[mysite]:~$ omd restart apache

Your work result is in multisite.mo. Please also keep the .po file. You need that file later if you want to further work on your translations. Both files can easily packaged into a Check_MK package.

1.1. Shortcut: update, edit and compile in one step

If you are using a plain text editor for editing the translation texts then Check_MK has a shortcut for you:

OMD[mysite]:~$ cmk --localize edit de

This command will first update or create the .po file, then call an editor in order for you to edit it and the automatically compile the .mo file.

1.2. Setting an alias for your language

After the upper steps users will be able to select your language in their personal profile. The selection - however - will just display your language code. If you want your new language to be displayed with a full name - e.g. Deutsch, then add this name as an optional argument to the update command. It is sufficient to do this once:

OMD[mysite]:~$ cmk --localize update de Deutsch

2. Using / selecting a language

Language selection in Multisite is possible in two ways:

2.1. Changing the global default

In your multisite.mk you can set the default language for all users with the variable default_language:

multisite.mk
default_language = "de"

This setting will apply for all users that have not changed their language as well as for the login screen (if you are using [multisite_login_dialog|cookie based login]).

2.2. Changing a users setting

Each user can select his or her preferred language in his personal settings page (reachable via the small icon in the sidebar between Add snapin and the logout button.