<commit_before>/**
 * Object to hold translations and perform translations
 */
var Translate = {
    /**
     * The loaded translations
     *
     * @type Object
     */
    _translations: {
    },

    /**
     * Fallback when language is unavailable
     *
     * @type String
     */
    _defaultLanguage: 'en_US',

    /**
     * The language selected
     *
     * @type String
     */
    _currentLanguage: 'en_US',

    /**
     * Select a language
     *
     * @param string language
     * @returns void
     */
    setLanguage: function(language) {
        Translate._currentLanguage = language;
    },

    /**
     * Add a language specification
     *
     * @param string language
     * @param Object translations
     * @param string domain
     * @returns void
     */
    addLanguage: function(language, translations, domain) {
        var domain = domain || '__messages';

        if (typeof Translate._translations[language] === 'undefined') {
            Translate._translations[language] = {};
        }
        if (typeof Translate._translations[language][domain] === 'undefined') {
            Translate._translations[language][domain] = {};
        }

        Translate._translations[language][domain] = translations;
    },

    /**
     * Lookup a translation
     *
     * @param string key
     * @param string domain
     * @returns String
     */
    lookup: function(key, domain) {
        var domain = domain || '__messages';

        var translations = Translate._translations[Translate._currentLanguage] || Translate._translations[Translate._defaultLanguage];

        if (typeof translations == 'undefined') {
            return domain + '_' + key;
        }
        else if (domain in translations === false) {
            return domain + '_' + key;
        }

        return translations[domain][key];
    }
};<commit_msg>Allow loading module multiple times, keep loaded module<commit_after>/**
 * Object to hold translations and perform translations
 */
if(typeof(Translate)=="undefined"){
    var Translate = {
        /**
         * The loaded translations
         *
         * @type Object
         */
        _translations: {
        },

        /**
         * Fallback when language is unavailable
         *
         * @type String
         */
        _defaultLanguage: 'en_US',

        /**
         * The language selected
         *
         * @type String
         */
        _currentLanguage: 'en_US',

        /**
         * Select a language
         *
         * @param string language
         * @returns void
         */
        setLanguage: function(language) {
            Translate._currentLanguage = language;
        },

        /**
         * Add a language specification
         *
         * @param string language
         * @param Object translations
         * @param string domain
         * @returns void
         */
        addLanguage: function(language, translations, domain) {
            var domain = domain || '__messages';

            if (typeof Translate._translations[language] === 'undefined') {
                Translate._translations[language] = {};
            }
            if (typeof Translate._translations[language][domain] === 'undefined') {
                Translate._translations[language][domain] = {};
            }

            Translate._translations[language][domain] = translations;
        },

        /**
         * Lookup a translation
         *
         * @param string key
         * @param string domain
         * @returns String
         */
        lookup: function(key, domain) {
            var domain = domain || '__messages';

            var translations = Translate._translations[Translate._currentLanguage] || Translate._translations[Translate._defaultLanguage];

            if (typeof translations == 'undefined') {
                return domain + '_' + key;
            }
            else if (domain in translations === false) {
                return domain + '_' + key;
            }

            return translations[domain][key];
        }
    };
}
{'fraction_non_alphanumeric': 0.10939036381514258, 'fraction_numerical': 0.0, 'mean_word_length': 1.7345430107526882, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '429409', 'n_tokens_mistral': 1038, 'n_tokens_neox': 988, 'n_words': 246}