<commit_before>'use strict';

kiwiWeb.controller('AppCtrl', ['$scope', '$window', 'MediaQuery', 'Transition', 'Menu', function ($scope, $window, MediaQuery, Transition, Menu) {

  $scope.screen = MediaQuery.screenSize();
  $scope.title = 'Kiwi Networks';
  $scope.styles = {};
  $scope.menu = Menu;
  $scope.menu.active = true;
  $scope.menu.current = $scope.menu.sections[0];

  $scope.changeTitle = function (title) {
    $scope.title = title;
  };

  $scope.menuToggle = function () {
    $scope.menu.active = !$scope.menu.active;
  };

  $scope.menuSectionToggle = function (section) {

    section.visible = !section.visible;

    if($scope.menu.current === null) {
      $scope.menu.current = section;
    } else if($scope.menu.current === section) {
      $scope.menu.current = null;
    } else {
      $scope.menu.current.visible = !$scope.menu.current.visible;
      $scope.menu.current = section;
    }
  };

  $scope.sectionStyle = function (visible, length) {
    return visible ? {'margin-top': '0'} : {'margin-top': '-' + length * (44 / 16) + 'rem'};
  };

  $scope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {

    if(toParams === fromParams) {
      console.log('Useless JSLint!');
    }

    $scope.styles.transition = Transition.getTransition(toState, toParams, fromState, fromParams);

  });

  $scope.$on('$stateChangeSuccess', function () {

    $scope.styles.page = '';

  });

  $(window).resize(function () {
    $scope.screen = MediaQuery.screenSize();
    $scope.$apply();
  });

}]);<commit_msg>Adds changeLanguage function.<commit_after>'use strict';

kiwiWeb.controller('AppCtrl', ['$scope', '$window', '$templateCache', 'MediaQuery', 'Transition', 'Menu', function ($scope, $window, $templateCache, MediaQuery, Transition, Menu) {

  $scope.screen = MediaQuery.screenSize();
  $scope.title = 'Kiwi Networks';
  $scope.styles = {};
  $scope.langKey = 'es';
  $scope.menu = Menu;
  $scope.menu.active = true;
  $scope.menu.current = $scope.menu.sections[0];

  $scope.changeTitle = function (title) {
    $scope.title = title;
  };

  $scope.menuToggle = function () {
    $scope.menu.active = !$scope.menu.active;
  };

  $scope.menuSectionToggle = function (section) {

    section.visible = !section.visible;

    if($scope.menu.current === null) {
      $scope.menu.current = section;
    } else if($scope.menu.current === section) {
      $scope.menu.current = null;
    } else {
      $scope.menu.current.visible = !$scope.menu.current.visible;
      $scope.menu.current = section;
    }
  };

  $scope.sectionStyle = function (visible, length) {
    return visible ? {'margin-top': '0'} : {'margin-top': '-' + length * (44 / 16) + 'rem'};
  };

  $scope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {

    if(toParams === fromParams) {
      console.log('Useless JSLint!');
    }

    $scope.styles.transition = Transition.getTransition(toState, toParams, fromState, fromParams);

  });

  $scope.$on('$stateChangeSuccess', function () {

    $scope.styles.page = '';

  });

  $(window).resize(function () {
    $scope.screen = MediaQuery.screenSize();
    $scope.$apply();
  });

  $scope.changeLanguage = function (template, langKey) {
    if($scope.langKey !== langKey)
      $scope.langKey = langKey;
    return $templateCache.get(template + '_' + langKey + '.json');
  }

}]);
{'fraction_non_alphanumeric': 0.18692964380335592, 'fraction_numerical': 0.003532528701795702, 'mean_word_length': 3.5367156208277706, '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': '6053320', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1089, 'n_words': 198}