text: 'use strict';
  
  angular.module('insight.system').controller('FooterController',
    function($scope, $route, $templateCache, gettextCatalog, amMoment,  Version) {
  
      $scope.defaultLanguage = defaultLanguage;
  
      var _getVersion = function() {
        Version.get({},
          function(res) {
            $scope.version = res.version;
          });
      };
  
      $scope.version = _getVersion();
  
      $scope.availableLanguages = [{
        name: 'Deutsch',
        isoCode: 'de_DE',
      }, {
        name: 'English',
        isoCode: 'en',
      }, {
        name: 'French',
        isoCode: 'fr_FR',
      }, {
        name: 'Spanish',
        isoCode: 'es',
      }, {
        name: 'Portuguese',
        isoCode: 'pt_BR',
      }, {
        name: 'Japanese',
        isoCode: 'ja',
      }, {
        name: 'Chinese',
        isoCode: 'zh',
      }];
  
      $scope.setLanguage = function(isoCode) {
        gettextCatalog.currentLanguage = $scope.defaultLanguage = defaultLanguage = isoCode;
        amMoment.changeLocale(isoCode);
        localStorage.setItem('insight-language', isoCode);
        var currentPageTemplate = $route.current.templateUrl;
        $templateCache.remove(currentPageTemplate);
        $route.reload();
      };
  
    });
  