Skip to content
This repository

In order to use the GetText translations in your script, you need to use the GetText micro library API.

GetText

The GetText variable is an instance of the GettextJson class. Use this variable to access the API.

Attributes

locale is the attribute to use when you want to set the locale to use :

GetText.locale = 'fr';

default_locale contains the default locale to use (‘en’ by default) :

GetText.default_locale = 'de';

translations contains all the translations :

GetText.translations = {
    "fr": {
        "Hello World": "Bonjour le Monde",
        "How are you ?": "Comment allez-vous ?"
    }
}

Methods

GetText.current_locale() Returns the currently used locale.

GetText.translate(string) Returns the translation of a string if it exists, otherwise the string itself is returned.

GetText.t(string) in an alias for GetText.translate(string).

Something went wrong with that request. Please try again.