Skip to content
Chris Jackson edited this page Jan 24, 2014 · 5 revisions

HABmin supports multiple language. There is a User Settings button in the top right corner of the window which allows setting of the language.

Language Selection

The default English strings are stored in /app/language/base.js. This provides a structure with all the English strings. To customise the strings, you need to make a new file called language.json in the same directory. Here language is the 2 digit country code defined by the ISO. So, for German, you would have "de.json". The system will use the default English strings unless a translation is provided in the translation file, so unless all strings are translated, you will end up with a mix of English and the native language. You won't have a situation where no strings are provided unless the language file specifies blanks.

Example files

In base.js, you have the following -:

var language = {
    error: "Error",
    warning: "Warning",
    success: "Success"
}

To provide a German translation, in the file "de.json" you would have the following. Note that the string names are surrounded by quotes.

{
    "error": "Fehler",
    "warning": "Warnung",
    "success": "Erfolg"
}

If you want to contribute language translations, that would be great. Please fork the code and send a pull request with the updated language file.