<commit_before>"use strict";
var fs = require('fs');
var async = require('async');
var Promise = require('promise');
var path = require('path');
var logger = require('./logger');
var DefaultLocalizer = (function () {
    function DefaultLocalizer(root, defaultLocale) {
        if (defaultLocale === void 0) { defaultLocale = 'en'; }
        this.localePaths = [];
        this.locales = {};
        this.defaultLocale(defaultLocale);
        var libsSeen = {};
        var _that = this;
        function addPaths(library) {
            if (!libsSeen.hasOwnProperty(library.name)) {
                libsSeen[library.name] = true;
                library.forEachLibrary(function (child) {
                    addPaths(child);
                });
                var path = library.localePath();
                if (path) {
                    _that.localePaths.push(path);
                }
            }
        }
        addPaths(root);
    }
    DefaultLocalizer.prototype.defaultLocale = function (locale) {
        if (locale) {
            this._defaultLocale = locale.toLowerCase();
        }
        else {
            return this._defaultLocale;
        }
    };
    DefaultLocalizer.prototype.load = function (locale, done) {
        var _this = this;
        logger.debug("localizer.load(%s)", locale);
        locale = locale ? locale.toLowerCase() : this._defaultLocale;
        var fbDefault = this.getFallback(this._defaultLocale);
        var fbLocale = this.getFallback(locale);
        var locales = ['en'];<commit_msg>Fixed an exception raised when a default local isn't specified.<commit_after>"use strict";
var fs = require('fs');
var async = require('async');
var Promise = require('promise');
var path = require('path');
var logger = require('./logger');
var DefaultLocalizer = (function () {
    function DefaultLocalizer(root, defaultLocale) {
        this.localePaths = [];
        this.locales = {};
        this.defaultLocale(defaultLocale || 'en');
        var libsSeen = {};
        var _that = this;
        function addPaths(library) {
            if (!libsSeen.hasOwnProperty(library.name)) {
                libsSeen[library.name] = true;
                library.forEachLibrary(function (child) {
                    addPaths(child);
                });
                var path = library.localePath();
                if (path) {
                    _that.localePaths.push(path);
                }
            }
        }
        addPaths(root);
    }
    DefaultLocalizer.prototype.defaultLocale = function (locale) {
        if (locale) {
            this._defaultLocale = locale.toLowerCase();
        }
        else {
            return this._defaultLocale;
        }
    };
    DefaultLocalizer.prototype.load = function (locale, done) {
        var _this = this;
        logger.debug("localizer.load(%s)", locale);
        locale = locale ? locale.toLowerCase() : this._defaultLocale;
        var fbDefault = this.getFallback(this._defaultLocale);
        var fbLocale = this.getFallback(locale);
        var locales = ['en'];
{'fraction_non_alphanumeric': 0.12361382909328114, 'fraction_numerical': 0.00032615786040443573, 'mean_word_length': 1.9980449657869013, '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': '647747', 'n_tokens_mistral': 812, 'n_tokens_neox': 795, 'n_words': 173}