<commit_before>var params;
function getParams (key) {
	if (!params) {
		params = {};
		var entries = window.location.search.substr(1).split('&');
		entries.forEach(function (entry) {
			entry = entry.split('=');
			if (entry[0]) {
				if (!entry[1]) {
					entry[1] = '';
				}
				params[entry[0]] = entry[1];
			}
		});
	}
	return params[key];
}

var CONFIG = {
	locales: [
		'en-US',
		'fr-FR',
	],
	bundles: [
		'accounts',
		'daysOfWeek',
		'profile',
		'activation',
		'devices',
		'registration',
		'adFormats',
		'errorPage',
		'stripe',
		'ads',
		'errors',
		'tactics',
		'campaigns',
		'invoices',
		'users',
		'common',
		'navbar',
		'widgets',
		'days',
		'payments',
	]
};

angular.module('myApp', [
		'ngLocalize',
		'ngLocalize.Config',
		'ngLocalize.InstalledLanguages',
		'agGrid',
	])
    .value('localeSupported', CONFIG.locales)
    .value('localeConf', {
        basePath: getParams('basePath'),
        defaultLocale: CONFIG.locales[0],
        sharedDictionary: 'common',
        fileExtension: '.lang.json',
        persistSelection: false,
        cookieName: 'COOKIE_LOCALE_LANG',
        observableAttrs: new RegExp('^data-(?!ng-|i18n)'),
        delimiter: '::'
    })
	.controller('myApp', function ($q, $timeout, $scope, $window, $interpolate, localeConf, locale) {
		var downloadjs = $window.download;

		$window.onbeforeunload = function(e) {
		  return 'All work will be lost!!!';
		};

        $($window.document.body).keydown(function (e) {
            var elm = e.target.nodeName.toLowerCase();
            if (e.which == 8 && elm !== 'input' && elm  !== 'textarea') {
                e.preventDefault();
            }
            // stopping event bubbling up the DOM tree..
            e.stopPropagation();
        });

		$scope.localeCache = {};

		$scope.errors = [];

		$scope.localeConf = localeConf;

		$scope.locales = CONFIG.locales.slice(1);
		$scope.selectedLocale = $scope.locales[0];
		$scope.bundles = CONFIG.bundles;

		$scope.gridOptions = {
			singleClickEdit: true,
	        pinnedColumnCount: 1,
	        enableColResize: true,
		};

		// load everything into memory;
		function loadBundles (localeIndex, cb) {
			var bundleIndex = 0;
			if (!CONFIG.locales[localeIndex]) {
				(cb || angular.noop)();
				return;
			}
			var localeName = CONFIG.locales[localeIndex];
            locale.setLocale(localeName);
			$scope.localeCache[localeName] = {};

			function next() {
				bundleIndex++;
				if (bundleIndex === CONFIG.bundles.length) {
					loadBundles(localeIndex + 1, cb);
				}
			}

			angular.forEach(CONFIG.bundles, function (bundleName) {
				locale.bundleReady(bundleName).then(function (bundle) {
					$scope.localeCache[localeName][bundleName] = bundle;
					next();
				}, function () {
					console.error("Failed to find bundle: " + bundleName);
					next();
				});
			});
		}

		function forLocales (cb) {
			angular.forEach($scope.localeCache, cb);<commit_msg>fix(app): Update bundleReady function name to protected method<commit_after>var params;
function getParams (key) {
	if (!params) {
		params = {};
		var entries = window.location.search.substr(1).split('&');
		entries.forEach(function (entry) {
			entry = entry.split('=');
			if (entry[0]) {
				if (!entry[1]) {
					entry[1] = '';
				}
				params[entry[0]] = entry[1];
			}
		});
	}
	return params[key];
}

var CONFIG = {
	locales: [
		'en-US',
		'fr-FR',
	],
	bundles: [
		'accounts',
		'daysOfWeek',
		'profile',
		'activation',
		'devices',
		'registration',
		'adFormats',
		'errorPage',
		'stripe',
		'ads',
		'errors',
		'tactics',
		'campaigns',
		'invoices',
		'users',
		'common',
		'navbar',
		'widgets',
		'days',
		'payments',
	]
};

angular.module('myApp', [
		'ngLocalize',
		'ngLocalize.Config',
		'ngLocalize.InstalledLanguages',
		'agGrid',
	])
    .value('localeSupported', CONFIG.locales)
    .value('localeConf', {
        basePath: getParams('basePath'),
        defaultLocale: CONFIG.locales[0],
        sharedDictionary: 'common',
        fileExtension: '.lang.json',
        persistSelection: false,
        cookieName: 'COOKIE_LOCALE_LANG',
        observableAttrs: new RegExp('^data-(?!ng-|i18n)'),
        delimiter: '::'
    })
	.controller('myApp', function ($q, $timeout, $scope, $window, $interpolate, localeConf, locale) {
		var downloadjs = $window.download;

		$window.onbeforeunload = function(e) {
		  return 'All work will be lost!!!';
		};

        $($window.document.body).keydown(function (e) {
            var elm = e.target.nodeName.toLowerCase();
            if (e.which == 8 && elm !== 'input' && elm  !== 'textarea') {
                e.preventDefault();
            }
            // stopping event bubbling up the DOM tree..
            e.stopPropagation();
        });

		$scope.localeCache = {};

		$scope.errors = [];

		$scope.localeConf = localeConf;

		$scope.locales = CONFIG.locales.slice(1);
		$scope.selectedLocale = $scope.locales[0];
		$scope.bundles = CONFIG.bundles;

		$scope.gridOptions = {
			singleClickEdit: true,
	        pinnedColumnCount: 1,
	        enableColResize: true,
		};

		// load everything into memory;
		function loadBundles (localeIndex, cb) {
			var bundleIndex = 0;
			if (!CONFIG.locales[localeIndex]) {
				(cb || angular.noop)();
				return;
			}
			var localeName = CONFIG.locales[localeIndex];
            locale.setLocale(localeName);
			$scope.localeCache[localeName] = {};

			function next() {
				bundleIndex++;
				if (bundleIndex === CONFIG.bundles.length) {
					loadBundles(localeIndex + 1, cb);
				}
			}

			angular.forEach(CONFIG.bundles, function (bundleName) {
				locale.$$bundleReady(bundleName).then(function (bundle) {
					$scope.localeCache[localeName][bundleName] = bundle;
					next();
				}, function () {
					console.error("Failed to find bundle: " + bundleName);
					next();
				});
			});
		}

		function forLocales (cb) {
			angular.forEach($scope.localeCache, cb);
{'fraction_non_alphanumeric': 0.17007262286775882, 'fraction_numerical': 0.005066711704104036, 'mean_word_length': 2.8858267716535435, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7335098', 'n_tokens_mistral': 2289, 'n_tokens_neox': 1985, 'n_words': 370}