<commit_before>(function () {
  'use strict';
  /**
   * @ngdoc overview
   * @name loopbackApp
   * @description
   * # loopbackApp
   *
   * Main module of the application.
   */
  angular
    .module('loopbackApp', [
      'angular-loading-bar',
      'angular.filter',
      'angularBootstrapNavTree',
      'angularFileUpload',
      'btford.markdown',
      'oitozero.ngSweetAlert',
      'config',
      'formly',
      'formlyBootstrap',
      'lbServices',
      'monospaced.elastic',
      'ngAnimate',
      'ngCookies',
      'ngResource',
      'ngRoute',
      'ngSanitize',
      'ngTouch',
      'ui.bootstrap',
      'ui.codemirror',
      'ui.gravatar',
      'ui.grid',
      'ui.router',
      'toasty',
      'autofields',
      'gettext',
      'angular-underscore/filters',
      'schemaForm',
      'ui.select',
      'com.module.core',
      'com.module.about',
      'com.module.browser',
      'com.module.events',
      'com.module.files',
      'com.module.notes',
      'com.module.pages',
      'com.module.posts',
      'com.module.products',
      'com.module.sandbox',
      'com.module.settings',
      'com.module.users'
    ])
    .run(function ($rootScope, $cookies, gettextCatalog) {

      $rootScope.locales = {
        'de': {
          lang: 'de',
          country: 'DE',
          name: gettextCatalog.getString('German')
        },
        'en': {
          lang: 'en',
          country: 'US',
          name: gettextCatalog.getString('English')
        },
        'es_MX': {
          lang: 'es_MX',
          country: 'MX',
          name: gettextCatalog.getString('Spanish')
        },
        'fr': {
          lang: 'fr',
          country: 'FR',
          name: gettextCatalog.getString('Français')
        },
        'nl': {
          lang: 'nl',
          country: 'NL',
          name: gettextCatalog.getString('Dutch')
        },
        'pt-BR': {
          lang: 'pt_BR',
          country: 'BR',
          name: gettextCatalog.getString('Portuguese Brazil')
        },
        'ru_RU': {
          lang: 'ru_RU',
          country: 'RU',
          name: gettextCatalog.getString('Russian')
        },
        'zh_CN': {
          lang: 'zh_CN',
          country: 'CN',
          name: gettextCatalog.getString('Chinese')
        }
      };

      var lang = $cookies.lang || navigator.language || navigator.userLanguage;

      $rootScope.locale = $rootScope.locales[lang];

      if ($rootScope.locale === undefined) {
        $rootScope.locale = $rootScope.locales[lang];
        if ($rootScope.locale === undefined) {
          $rootScope.locale = $rootScope.locales['en'];
        }
      }

      gettextCatalog.setCurrentLanguage($rootScope.locale.lang);

    })
    .run(function (formlyConfig) {
      /*
       ngModelAttrs stuff
       */
      var ngModelAttrs = {};
<commit_msg>Better undefined checking<commit_after>(function () {
  'use strict';
  /**
   * @ngdoc overview
   * @name loopbackApp
   * @description
   * # loopbackApp
   *
   * Main module of the application.
   */
  angular
    .module('loopbackApp', [
      'angular-loading-bar',
      'angular.filter',
      'angularBootstrapNavTree',
      'angularFileUpload',
      'btford.markdown',
      'oitozero.ngSweetAlert',
      'config',
      'formly',
      'formlyBootstrap',
      'lbServices',
      'monospaced.elastic',
      'ngAnimate',
      'ngCookies',
      'ngResource',
      'ngRoute',
      'ngSanitize',
      'ngTouch',
      'ui.bootstrap',
      'ui.codemirror',
      'ui.gravatar',
      'ui.grid',
      'ui.router',
      'toasty',
      'autofields',
      'gettext',
      'angular-underscore/filters',
      'schemaForm',
      'ui.select',
      'com.module.core',
      'com.module.about',
      'com.module.browser',
      'com.module.events',
      'com.module.files',
      'com.module.notes',
      'com.module.pages',
      'com.module.posts',
      'com.module.products',
      'com.module.sandbox',
      'com.module.settings',
      'com.module.users'
    ])
    .run(function ($rootScope, $cookies, gettextCatalog) {

      $rootScope.locales = {
        'de': {
          lang: 'de',
          country: 'DE',
          name: gettextCatalog.getString('German')
        },
        'en': {
          lang: 'en',
          country: 'US',
          name: gettextCatalog.getString('English')
        },
        'es_MX': {
          lang: 'es_MX',
          country: 'MX',
          name: gettextCatalog.getString('Spanish')
        },
        'fr': {
          lang: 'fr',
          country: 'FR',
          name: gettextCatalog.getString('Français')
        },
        'nl': {
          lang: 'nl',
          country: 'NL',
          name: gettextCatalog.getString('Dutch')
        },
        'pt-BR': {
          lang: 'pt_BR',
          country: 'BR',
          name: gettextCatalog.getString('Portuguese Brazil')
        },
        'ru_RU': {
          lang: 'ru_RU',
          country: 'RU',
          name: gettextCatalog.getString('Russian')
        },
        'zh_CN': {
          lang: 'zh_CN',
          country: 'CN',
          name: gettextCatalog.getString('Chinese')
        }
      };

      var lang = $cookies.lang || navigator.language || navigator.userLanguage;

      $rootScope.locale = $rootScope.locales[lang];

      if (angular.isUndefined($rootScope.locale)) {
        $rootScope.locale = $rootScope.locales[lang];
        if (angular.isUndefined($rootScope.locale)) {
          $rootScope.locale = $rootScope.locales['en'];
        }
      }

      gettextCatalog.setCurrentLanguage($rootScope.locale.lang);

    })
    .run(function (formlyConfig) {
      /*
       ngModelAttrs stuff
       */
      var ngModelAttrs = {};

{'fraction_non_alphanumeric': 0.1543296089385475, 'fraction_numerical': 0.0, 'mean_word_length': 1.7905504140282513, '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': '726886', 'n_tokens_mistral': 1820, 'n_tokens_neox': 1798, 'n_words': 284}