<commit_before>(function(Translator, _, Oro) {
    var dict = {},
        add = Translator.add;

    /**
     * Store all translation ids which were added to Translator
     * @param id
     */
    Translator.add = function(id) {
        dict[id] = 1;
        add.apply(Translator, arguments);
    };

    /**
     * Checks if translation for passed id exist, if it's Oro.debug mode
     * and there's no translation - output error message in console
     * @param id
     */
    function checkTranslation(id) {
        if (!Oro.debug) {
            return;
        }
        var domains = Translator.defaultDomains,
            checker = function (domain){
                return dict.hasOwnProperty(domain ? domain + ':' + id : id);
            };
        domains = _.union([undefined], _.isArray(domains) ? domains : [domains]);
        if (!_.some(domains, checker)) {
            console.error('Translation "%s" does not exist!', id);
        }
    }

    _.mixin({
        /**
         * Shortcut for Translator.get() method call,
         * Due to it's underscore mixin, it can be used inside templates
         * @param id
         * @returns {string}
         */
        __: function(id) {
            checkTranslation(id);
            return Translator.get.apply(Translator, arguments);
        }
    });
}) (Translator, _, Oro);<commit_msg>BAP-1194: Implement wrapper for Translator.get() call   - CR-changes<commit_after>(function(Translator, _, Oro) {
    var dict = {},
        add = Translator.add,
        get = Translator.get;

    /**
     * Adds a translation to Translator object and stores
     * translation id in protected dictionary
     * @param {string} id
     */
    Translator.add = function(id) {
        dict[id] = 1;
        add.apply(Translator, arguments);
    };

    /**
     * Fetches translation by its id,
     * but before checks if the id was registered in dictionary
     * @param {string} id
     * @returns {string}
     */
    Translator.get = function(id) {
        checkTranslation(id);
        return get.apply(Translator, arguments);
    };

    /**
     * Checks if translation for passed id exist, if it's Oro.debug mode
     * and there's no translation - output error message in console
     * @param {string} id
     */
    function checkTranslation(id) {
        if (!Oro.debug) {
            return;
        }
        var domains = Translator.defaultDomains,
            checker = function (domain){
                return dict.hasOwnProperty(domain ? domain + ':' + id : id);
            };
        domains = _.union([undefined], _.isArray(domains) ? domains : [domains]);
        if (!_.some(domains, checker)) {
            console.error('Untranslated: %s', id);
        }
    }

    _.mixin({
        /**
         * Shortcut for Translator.get() method call,
         * Due to it's underscore mixin, it can be used inside templates
         * @returns {string}
         */
        __: _.bind(Translator.get, Translator)
    });
}) (Translator, _, Oro);
{'fraction_non_alphanumeric': 0.12151394422310757, 'fraction_numerical': 0.00199203187250996, 'mean_word_length': 1.9280855199222546, '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': '4044613', 'n_tokens_mistral': 884, 'n_tokens_neox': 850, 'n_words': 237}