<commit_before>(function() {
    var locale;
    var messages = {};


    /* Utility functions: */

    /**
     * Replace variables used in the message by appropriate values.
     *
     * @method applyReplacements
     * @static
     * @param {String} message      Input message.
     * @param {Object} replacements Associative array: { variableName: "replacement", ... }
     * @return {String} The input message with all replacements applied.
     */
    var applyReplacements = function (message, replacements) {
        for (var replacementName in replacements) {
            var replacement = replacements[replacementName];

            var regex = new RegExp(':'+replacementName, 'g');
            message = message.replace(regex, replacement);
        }

        return message;
    };

    var isEmpty = function (obj) {
        for(var prop in obj) {
            if(obj.hasOwnProperty(prop))
                return false;
        }

        return true;
    };


    /* Lang: */

    /**
     * Lang class. Works similar to the Laravel Lang object.<commit_msg>Add support in localization.js for case-based replacement<commit_after>(function() {
    var locale;
    var messages = {};


    /* Utility functions: */

    /**
     * Replace variables used in the message by appropriate values.
     *
     * @method applyReplacements
     * @static
     * @param {String} message      Input message.
     * @param {Object} replacements Associative array: { variableName: "replacement", ... }
     * @return {String} The input message with all replacements applied.
     */
    var applyReplacements = function (message, replacements) {
        for (var replacementName in replacements) {
            var replacement = replacements[replacementName];

            message = message.replace(
                new RegExp(':' + replacementName, 'g'),
                replacement
            );
            message = message.replace(
                new RegExp(':' + replacementName.toUpperCase(), 'g'),
                replacement.toUpperCase()
            );
            message = message.replace(
                new RegExp(':' + (replacementName.charAt(0).toUpperCase() + replacementName.substr(1)), 'g'),
                replacement.charAt(0).toUpperCase() + replacement.substr(1)
            );
        }

        return message;
    };

    var isEmpty = function (obj) {
        for(var prop in obj) {
            if(obj.hasOwnProperty(prop))
                return false;
        }

        return true;
    };


    /* Lang: */

    /**
     * Lang class. Works similar to the Laravel Lang object.
{'fraction_non_alphanumeric': 0.10962054426983518, 'fraction_numerical': 0.0015331544653123803, 'mean_word_length': 1.955832389580974, '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': '2734236', 'n_tokens_mistral': 696, 'n_tokens_neox': 647, 'n_words': 192}