Modules (188)

LocalizationUtils

Description

Utilities functions related to localization/i18n

Dependencies

Functions

Public API

getLocalizedLabel

Converts a language code to its written name, if possible. If not possible, the language code is simply returned.

locale string
The two-char language code
Returns: string
The language's name or the given language code
    function getLocalizedLabel(locale) {
        var key  = "LOCALE_" + locale.toUpperCase().replace("-", "_"),
            i18n = Strings[key];

        return i18n === undefined ? locale : i18n;
    }


    // Define public API
    exports.getLocalizedLabel = getLocalizedLabel;
});