<commit_before>'use strict';
angular.module('arethusa', [
  'angulartics',
  'angulartics.google.analytics',
  'mm.foundation',
  'ngRoute',
  'arethusa.core',
  'arethusa.contextMenu',
  'arethusa.history'
]);

angular.module('arethusa').config([
  '$routeProvider',
  '$translateProvider',
  'MAIN_ROUTE',
  function ($routeProvider, $translateProvider,
            MAIN_ROUTE) {
    if (aU.isArethusaMainApplication()) {
      $routeProvider.when('/', MAIN_ROUTE);
      //$routeProvider.when('/conf_editor', CONF_ROUTE);
      $routeProvider.when('/:conf', MAIN_ROUTE);
      //$routeProvider.when('/conf_editor/:conf', CONF_ROUTE);
    }

    $translateProvider
      .useStaticFilesLoader({
        prefix: arethusa.basePath + '/dist/i18n/',
        suffix: '.json'
      })

      .registerAvailableLanguageKeys(['en', 'de'], {
        'en_*' : 'en',
        'de_*' : 'de'
      })
      .determinePreferredLanguage()
      .fallbackLanguage('en');
  },
]);

angular.module('arethusa').value('CONF_PATH', '../dist/configs');
angular.module('arethusa').value('BASE_PATH', '..');

function Arethusa() {
  var self = this;

  self.basePath = '..';

  function Api(injector) {
    var api = this;
    var $compile = injector.get('$compile');

    this.configurator = injector.get('configurator');

    this.configure = function(conf) {
      api.configurator.defineConfiguration(conf);
    };

    this.watchUrl = function(bool) {
      injector.get('locator').watchUrl(bool);
    };

    this.setBasePath = function(path) {
      injector.get('basePath').set(path);
    };

    this.setParams = function(a, b) {
      injector.get('locator').set(a, b);
    };

    this.compile = function(element) {
      var html = element[0].innerHTML;
      element.html($compile(html)(element.scope()));
    };

    this.state = injector.get('state');

    //this.setBasePath(self.basePath);
  }

  this.setConfPath = function(path) {
    angular.module('arethusa').value('CONF_PATH', path);
  };

  this.setBasePath = function(path) {
    angular.module('arethusa').value('BASE_PATH', path);
  };<commit_msg>Better base path handling for translate files<commit_after>'use strict';
angular.module('arethusa', [
  'angulartics',
  'angulartics.google.analytics',
  'mm.foundation',
  'ngRoute',
  'arethusa.core',
  'arethusa.contextMenu',
  'arethusa.history'
]);

angular.module('arethusa').config([
  '$routeProvider',
  '$translateProvider',
  'MAIN_ROUTE',
  function ($routeProvider, $translateProvider,
            MAIN_ROUTE) {
    if (aU.isArethusaMainApplication()) {
      $routeProvider.when('/', MAIN_ROUTE);
      //$routeProvider.when('/conf_editor', CONF_ROUTE);
      $routeProvider.when('/:conf', MAIN_ROUTE);
      //$routeProvider.when('/conf_editor/:conf', CONF_ROUTE);
    }

    $translateProvider
      .useStaticFilesLoader({
        prefix: arethusa.basePath + '/dist/i18n/',
        suffix: '.json'
      })

      .registerAvailableLanguageKeys(['en', 'de'], {
        'en_*' : 'en',
        'de_*' : 'de'
      })
      .determinePreferredLanguage()
      .fallbackLanguage('en');
  },
]);

angular.module('arethusa').value('CONF_PATH', '../dist/configs');
angular.module('arethusa').value('BASE_PATH', '..');

function Arethusa() {
  var self = this;

  self.basePath = '..';

  function Api(injector) {
    var api = this;
    var $compile = injector.get('$compile');

    this.configurator = injector.get('configurator');

    this.configure = function(conf) {
      api.configurator.defineConfiguration(conf);
    };

    this.watchUrl = function(bool) {
      injector.get('locator').watchUrl(bool);
    };

    this.setBasePath = function(path) {
      injector.get('basePath').set(path);
    };

    this.setParams = function(a, b) {
      injector.get('locator').set(a, b);
    };

    this.compile = function(element) {
      var html = element[0].innerHTML;
      element.html($compile(html)(element.scope()));
    };

    this.state = injector.get('state');

    //this.setBasePath(self.basePath);
  }

  this.setConfPath = function(path) {
    angular.module('arethusa').value('CONF_PATH', path);
  };

  this.setBasePath = function(path) {
    self.basePath = path;
    angular.module('arethusa').value('BASE_PATH', path);
  };
{'fraction_non_alphanumeric': 0.18098591549295776, 'fraction_numerical': 0.0014084507042253522, 'mean_word_length': 3.2738214643931793, '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': '3696389', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1409, 'n_words': 194}