<commit_before>(function() {
  
  'use strict';
  
  angular
    .module('harbor.services.i18n')
    .factory('I18nService', I18nService);
  
  I18nService.$inject = ['$cookies', '$window'];
  
  function I18nService($cookies, $window) {
    var languages = $.extend(true, {}, global_messages);
    var defaultLanguage = navigator.language || 'en-US';
    var languageNames = {
      'en-US': 'English',
      'zh-CN': '中文'
    };    
    return tr;
    function tr() {
      return {
        'setCurrentLanguage': function(language) {          
          if(!language){
            language = defaultLanguage;
          }
          $cookies.put('language', language, {'path': '/ng/'});
          $window.location.reload();
        },
        'getCurrentLanguage': function() {
          return $cookies.get('language') || defaultLanguage;
        },
        'getLanguageName': function(crrentLanguage) {
          return languageNames[crrentLanguage];    
        },
        'getValue': function(key, currentLanguage) {
          return languages[key][currentLanguage];
        }
      }
    }
  }
  
})();<commit_msg>updates for switch language cookies setting.<commit_after>(function() {
  
  'use strict';
  
  angular
    .module('harbor.services.i18n')
    .factory('I18nService', I18nService);
  
  I18nService.$inject = ['$cookies', '$window'];
  
  function I18nService($cookies, $window) {
    var languages = $.extend(true, {}, global_messages);
    var defaultLanguage = navigator.language || 'en-US';
    var languageNames = {
      'en-US': 'English',
      'zh-CN': '中文'
    };    
    return tr;
    function tr() {
      return {
        'setCurrentLanguage': function(language) {          
          if(!language){
            language = defaultLanguage;
          }
          $cookies.put('language', language, {'path': '/'});
          $window.location.reload();
        },
        'getCurrentLanguage': function() {
          return $cookies.get('language') || defaultLanguage;
        },
        'getLanguageName': function(crrentLanguage) {
          return languageNames[crrentLanguage];    
        },
        'getValue': function(key, currentLanguage) {
          return languages[key][currentLanguage];
        }
      }
    }
  }
  
})();
{'fraction_non_alphanumeric': 0.15092674315975288, 'fraction_numerical': 0.0088261253309797, 'mean_word_length': 2.2385714285714284, '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': '7245092', 'n_tokens_mistral': 660, 'n_tokens_neox': 651, 'n_words': 116}