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

HABmin supports multiple language. It uses the browser language to detect the language, and can then load a language set from this.

Note that this is currently in development, and a lot (ie MOST) strings are still hardcoded in the code. I'll migrate this over in time.

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 .json in the same directory. Here is the 2 digit country code defined by the ISO. So, for German, you would have "de.json".

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.