<commit_before>'use strict';
AMIApp.controller('RequestCtrl', ['$scope', '$location', '$window', '$timeout', 'NavCollection', 'AMIRequest', 'pdfOptionEnabled', '$translate', 'urls', function ($scope, $location, $window, $timeout, NavCollection, AMIRequest, pdfOptionEnabled, $translate, urls) {
  var blurListener;
  var ami_service_ids_en;
  $window.scrollTo(0,0);
  $scope.shareURL = encodeURIComponent($window.location.origin);
  $translate(['finish.share-text', 'finish.atipLink', 'finish.date-format'], {shareURL: $window.location.origin }).then(function (translation) {
    $scope.shareText = encodeURIComponent(translation["finish.share-text"]);
    $scope.atipLink = translation["finish.atipLink"];
    $scope.date = moment().format(translation["finish.date-format"]);
    $scope.date_req = $scope.date;
    AMIRequest.set('date', $scope.date);
  });
  var eng_moment = moment();
  eng_moment.locale('en');  
  $scope.date_en = eng_moment.format('MMMM Do, YYYY');
  $scope.nextIsLoading = false;

  $scope.lang = urls.languageCode;
  $scope.lang_en = "en";

  $scope.$watch(function(){
    $scope.previousStage = NavCollection.previousItem();
    $scope.nextStage = NavCollection.nextItem();
  });
  $scope.previous = function(){
    $location.url($scope.previousStage.id);
  }
  $scope.next = function(){
    $location.url($scope.nextStage.id);
  }
  if(!AMIRequest.has('subject') || !AMIRequest.has('operator') || !AMIRequest.has('services' || !(typeof _.findWhere(AMIRequest.get('services'), {selected: true}) !== "undefined")) || AMIRequest.has('')){
    $scope.previous();
    return;
  }
  $scope.dropRequest = function(){
    AMIRequest.drop('industry');
  }

  $scope.pdfOptionEnabled = pdfOptionEnabled;
  $scope.components = AMIRequest.get('components');

  $scope.jurisdiction = AMIRequest.get('jurisdiction');
  $scope.industry = AMIRequest.get('industry');
  $scope.operator = AMIRequest.get('operator');
  $scope.services = AMIRequest.get('services');
  $scope.subject = AMIRequest.get('subject');

  $scope.industry_en = AMIRequest.getEnglish('industry', 'industries_en');
  $scope.operator_en = AMIRequest.getEnglish('operator', 'companies_en');
  $scope.subject_en = {};
  console.log($scope.components, AMIRequest.get('components_en'));
  //get all req components in English in proper structure
  $scope.componentdata_en = AMIRequest.getEnglish(null, 'components_en', _.filter($scope.components['data']['items'], function(i){
    return i.selected;
  }));
  $scope.componentquestions_en = AMIRequest.getEnglish(null, 'components_en', _.filter($scope.components['questions']['items'], function(i){
    return i.selected;
  }));
  $scope.componentbanks_en = AMIRequest.getEnglish(null, 'components_en', _.filter($scope.components['dataBanks']['items'], function(i){
    return i.selected;
  }));
  console.log(AMIRequest.get('subject_en'));
  $scope.subject_en.basic_personal_info = AMIRequest.getEnglish(null, AMIRequest.get('subject_en').basic_personal_info, $scope.subject.basic_personal_info);
  //get all serviec identifiers in English in proper structure
  $scope.subject_en.service_identifiers = {};

  ami_service_ids_en =  AMIRequest.get('subject_en').service_identifiers;
  
  _.each(ami_service_ids_en, function(service, service_id, list){
    $scope.subject_en.service_identifiers[service_id] = AMIRequest.getEnglish(null, service, $scope.subject.service_identifiers[service_id]);
  });

  console.log("english_req", $scope.industry_en);<commit_msg>french data banks title translation in request<commit_after>'use strict';
AMIApp.controller('RequestCtrl', ['$scope', '$location', '$window', '$timeout', 'NavCollection', 'AMIRequest', 'pdfOptionEnabled', '$translate', 'urls', function ($scope, $location, $window, $timeout, NavCollection, AMIRequest, pdfOptionEnabled, $translate, urls) {
  var blurListener;
  var ami_service_ids_en;
  $window.scrollTo(0,0);
  $scope.shareURL = encodeURIComponent($window.location.origin);
  $translate(['finish.share-text', 'finish.atipLink', 'finish.date-format'], {shareURL: $window.location.origin }).then(function (translation) {
    $scope.shareText = encodeURIComponent(translation["finish.share-text"]);
    $scope.atipLink = translation["finish.atipLink"];
    $scope.date = moment().format(translation["finish.date-format"]);
    $scope.date_req = $scope.date;
    AMIRequest.set('date', $scope.date);
  });
  var eng_moment = moment();
  eng_moment.locale('en');  
  $scope.date_en = eng_moment.format('MMMM Do, YYYY');
  $scope.nextIsLoading = false;

  $scope.lang = urls.languageCode;
  $scope.lang_en = "en";

  $scope.$watch(function(){
    $scope.previousStage = NavCollection.previousItem();
    $scope.nextStage = NavCollection.nextItem();
  });
  $scope.previous = function(){
    $location.url($scope.previousStage.id);
  }
  $scope.next = function(){
    $location.url($scope.nextStage.id);
  }
  if(!AMIRequest.has('subject') || !AMIRequest.has('operator') || !AMIRequest.has('services' || !(typeof _.findWhere(AMIRequest.get('services'), {selected: true}) !== "undefined")) || AMIRequest.has('')){
    $scope.previous();
    return;
  }
  $scope.dropRequest = function(){
    AMIRequest.drop('industry');
  }

  $scope.pdfOptionEnabled = pdfOptionEnabled;
  $scope.components = AMIRequest.get('components');

  $scope.jurisdiction = AMIRequest.get('jurisdiction');
  $scope.industry = AMIRequest.get('industry');
  $scope.operator = AMIRequest.get('operator');
  $scope.services = AMIRequest.get('services');
  $scope.subject = AMIRequest.get('subject');

  $scope.industry_en = AMIRequest.getEnglish('industry', 'industries_en');
  $scope.operator_en = AMIRequest.getEnglish('operator', 'companies_en');
  $scope.subject_en = {};
  console.log($scope.components, AMIRequest.get('components_en'));
  //get all req components in English in proper structure
  $scope.componentdata_en = AMIRequest.getEnglish(null, 'components_en', _.filter($scope.components['data']['items'], function(i){
    return i.selected;
  }));
  $scope.componentquestions_en = AMIRequest.getEnglish(null, 'components_en', _.filter($scope.components['questions']['items'], function(i){
    return i.selected;
  }));
  $scope.componentbanks_en = AMIRequest.getEnglish(null, 'components_en', _.filter($scope.components['dataBanks']['items'], function(i){
    return i.selected;
  }));

  console.log(AMIRequest.get('subject_en'));
  $scope.subject_en.basic_personal_info = AMIRequest.getEnglish(null, AMIRequest.get('subject_en').basic_personal_info, $scope.subject.basic_personal_info);
  //get all serviec identifiers in English in proper structure
  $scope.subject_en.service_identifiers = {};

  ami_service_ids_en =  AMIRequest.get('subject_en').service_identifiers;
  
  _.each(ami_service_ids_en, function(service, service_id, list){
    $scope.subject_en.service_identifiers[service_id] = AMIRequest.getEnglish(null, service, $scope.subject.service_identifiers[service_id]);
  });
  _.each($scope.componentbanks_en, function(component, index, list){
    $scope.componentbanks_en[index]['data'] = component.title + " (" + component.meta.data_bank_number + ")";
  });

  console.log("english_req", $scope.industry_en);
{'fraction_non_alphanumeric': 0.1720684378912227, 'fraction_numerical': 0.0005564056196967589, 'mean_word_length': 5.880382775119617, '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': '2628016', 'n_tokens_mistral': 2302, 'n_tokens_neox': 2284, 'n_words': 342}