translate app + add french translation

This commit is contained in:
Sam 2016-05-05 16:00:58 +03:00
parent 2981a90f57
commit c6864c6db6
9 changed files with 60 additions and 17 deletions

View file

@ -4,25 +4,30 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
$translateProvider.translations('english', { $translateProvider.translations('english', {
FORM_SUCCESS: 'Form entry successfully submitted!', FORM_SUCCESS: 'Form entry successfully submitted!',
SUBMIT: 'Submit',
REVIEW: 'Review',
BACK_TO_FORM: 'Go back to Form', BACK_TO_FORM: 'Go back to Form',
EDIT_FORM: 'Edit this TellForm', EDIT_FORM: 'Edit this TellForm',
CREATE_FORM: 'Create this TellForm', CREATE_FORM: 'Create this TellForm',
ADVANCEMENT: '{{done}} out of {{total}} answered', ADVANCEMENT: '{{done}} out of {{total}} answered',
CONTINUE_FORM: 'Continue to Form', CONTINUE_FORM: 'Continue to Form',
REQUIRED: 'required', REQUIRED: 'required',
COMPLETING_NEEDED: '{{answers_not_completed}} answer(s) need completing',
OPTIONAL: 'optional', OPTIONAL: 'optional',
ERROR_EMAIL_INVALID: 'Please enter a valid email address', ERROR_EMAIL_INVALID: 'Please enter a valid email address',
ERROR_NOT_A_NUMBER: 'Please enter valid numbers only', ERROR_NOT_A_NUMBER: 'Please enter valid numbers only',
ERROR_URL_INVALID: 'Please a valid url', ERROR_URL_INVALID: 'Please a valid url',
OK: 'OK', OK: 'OK',
ENTER: 'press ENTER', ENTER: 'press ENTER',
YES: 'Yes',
NO: 'No',
NEWLINE: 'press SHIFT+ENTER to create a newline',
CONTINUE: 'Continue', CONTINUE: 'Continue',
LEGAL_ACCEPT: 'I accept', LEGAL_ACCEPT: 'I accept',
LEGAL_NO_ACCEPT: 'I dont accept', LEGAL_NO_ACCEPT: 'I dont accept',
DELETE: 'Delete', DELETE: 'Delete',
CANCEL: 'Cancel', CANCEL: 'Cancel',
UPLOAD_FILE: 'Upload your File', UPLOAD_FILE: 'Upload your File',
SUBMIT: 'Submit'
}); });
$translateProvider.preferredLanguage('english') $translateProvider.preferredLanguage('english')

View file

@ -4,25 +4,30 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
$translateProvider.translations('french', { $translateProvider.translations('french', {
FORM_SUCCESS: 'Votre formulaire a été enregistré!', FORM_SUCCESS: 'Votre formulaire a été enregistré!',
REVIEW: 'Review',
BACK_TO_FORM: 'Retourner au formulaire', BACK_TO_FORM: 'Retourner au formulaire',
EDIT_FORM: 'Éditer le Tellform', EDIT_FORM: 'Éditer le Tellform',
CREATE_FORM: 'Créer un TellForm', CREATE_FORM: 'Créer un TellForm',
ADVANCEMENT: '{{done}} complétés sur {{total}}', ADVANCEMENT: '{{done}} complétés sur {{total}}',
CONTINUE_FORM: 'Aller au formulaire', CONTINUE_FORM: 'Aller au formulaire',
REQUIRED: 'obligatoire', REQUIRED: 'obligatoire',
COMPLETING_NEEDED: '{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)',
OPTIONAL: 'facultatif', OPTIONAL: 'facultatif',
ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide', ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide',
ERROR_NOT_A_NUMBER: 'Merce de ne rentrer que des nombres', ERROR_NOT_A_NUMBER: 'Merce de ne rentrer que des nombres',
ERROR_URL_INVALID: 'Merci de rentrer une url valide', ERROR_URL_INVALID: 'Merci de rentrer une url valide',
OK: 'OK', OK: 'OK',
ENTER: 'presser ENTRÉE', ENTER: 'presser ENTRÉE',
YES: 'Oui',
NO: 'Non',
NEWLINE: 'presser SHIFT+ENTER pour créer une nouvelle ligne',
CONTINUE: 'Continuer', CONTINUE: 'Continuer',
LEGAL_ACCEPT: 'Jaccepte', LEGAL_ACCEPT: 'Jaccepte',
LEGAL_NO_ACCEPT: 'Jen naccepte pas', LEGAL_NO_ACCEPT: 'Je naccepte pas',
DELETE: 'Supprimer', DELETE: 'Supprimer',
CANCEL: 'Réinitialiser', CANCEL: 'Réinitialiser',
UPLOAD_FILE: 'Envoyer des fichier', SUBMIT: 'Enregistrer',
SUBMIT: 'Enregistrer' UPLOAD_FILE: 'Envoyer un fichier',
}); });
}]); }]);

View file

@ -8,7 +8,7 @@ angular.module('forms', [
angular.module('NodeForm', [ angular.module('NodeForm', [
'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource', 'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource',
'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven', 'forms', 'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven', 'forms',
'ui.select' 'ui.select'
]); ]);
angular.module('forms').factory('Auth', [ angular.module('forms').factory('Auth', [

File diff suppressed because one or more lines are too long

View file

@ -19,9 +19,12 @@ angular.module('forms').directive('submitFormDirective',
} }
return true; return true;
}).length; }).length;
var nb_valid = $filter('formValidity')($scope.myform);
$scope.translateAdvancementData = { $scope.translateAdvancementData = {
done: $filter('formValidity')($scope.myform), done: nb_valid,
total: form_fields_count total: form_fields_count,
answers_not_completed: form_fields_count - nb_valid
}; };
$scope.reloadForm = function(){ $scope.reloadForm = function(){
@ -105,9 +108,11 @@ angular.module('forms').directive('submitFormDirective',
$scope.selected._id = field_id; $scope.selected._id = field_id;
$scope.selected.index = field_index; $scope.selected.index = field_index;
var nb_valid = $filter('formValidity')($scope.myform);
$scope.translateAdvancementData = { $scope.translateAdvancementData = {
done: $filter('formValidity')($scope.myform), done: nb_valid,
total: form_fields_count total: form_fields_count,
answers_not_completed: form_fields_count - nb_valid
}; };
if(animateScroll){ if(animateScroll){

View file

@ -29,7 +29,7 @@
<div class="letter" style="float:left"> <div class="letter" style="float:left">
Y Y
</div> </div>
<span> {{ 'LEGAL_ACCEPT' | translate }} </span> <span>{{ 'LEGAL_ACCEPT' | translate }}</span>
</label> </label>
<label class="btn col-md-5 col-md-offset-1 col-xs-12" <label class="btn col-md-5 col-md-offset-1 col-xs-12"
ng-class="{activeBtn: field.fieldValue == 'false'}"> ng-class="{activeBtn: field.fieldValue == 'false'}">
@ -44,7 +44,7 @@
<div class="letter" style="float:left"> <div class="letter" style="float:left">
N N
</div> </div>
<span>{{ 'LEGAL_NO_ACCEPT' | translate }} </span> <span>{{ 'LEGAL_NO_ACCEPT' | translate }}</span>
</label> </label>
</div> </div>

View file

@ -7,9 +7,9 @@
<i class="fa fa-angle-double-right" aria-hidden="true"></i> <i class="fa fa-angle-double-right" aria-hidden="true"></i>
</small> </small>
{{field.title}} {{field.title}}
<span class="required-error" ng-show="!field.required">optional</span> <span class="required-error" ng-show="!field.required">{{ 'OPTIONAL' | translate }}</span>
</h3> </h3>
<small>press SHIFT+ENTER to create a newline</small> <small>{{ 'NEWLINE' | translate }}</small>
</div> </div>
<div class="col-xs-12 field-input"> <div class="col-xs-12 field-input">
<textarea class="textarea focusOn" type="text" <textarea class="textarea focusOn" type="text"

View file

@ -34,7 +34,7 @@
<div class="letter"> <div class="letter">
Y Y
</div> </div>
<span>Yes</span> <span>{{ 'YES' | translate }}</span>
<i ng-show="field.fieldValue === 'true'" class="fa fa-check" aria-hidden="true"></i> <i ng-show="field.fieldValue === 'true'" class="fa fa-check" aria-hidden="true"></i>
</label> </label>
</div> </div>
@ -55,7 +55,7 @@
<div class="letter"> <div class="letter">
N N
</div> </div>
<span>No</span> <span>{{ 'NO' | translate }}</span>
<i ng-show="field.fieldValue === 'false'" class="fa fa-check" aria-hidden="true"></i> <i ng-show="field.fieldValue === 'false'" class="fa fa-check" aria-hidden="true"></i>
</label> </label>
</div> </div>

View file

@ -70,6 +70,7 @@ ng-style="{'color':button.color}">
<div class="col-xs-12 text-left" <div class="col-xs-12 text-left"
style="background-color:#990000; color:white;" style="background-color:#990000; color:white;"
ng-if="forms.myForm.$invalid"> ng-if="forms.myForm.$invalid">
{{ 'COMPLETING_NEEDED' | translate:translateAdvancementData }}
{{form_fields_count - (myform | formValidity)}} answer(s) need completing {{form_fields_count - (myform | formValidity)}} answer(s) need completing
</div> </div>
@ -88,7 +89,7 @@ ng-style="{'color':button.color}">
class="Button btn col-sm-2 col-xs-8" class="Button btn col-sm-2 col-xs-8"
ng-click="goToInvalid()" ng-click="goToInvalid()"
style="font-size: 1.6em; margin-left: 1em; margin-top: 1em; background-color:#990000; color:white"> style="font-size: 1.6em; margin-left: 1em; margin-top: 1em; background-color:#990000; color:white">
Review {{ 'REVIEW' | translate }}
</button> </button>
<div class="col-sm-2 hidden-xs" style="font-size: 75%; margin-top:3.25em"> <div class="col-sm-2 hidden-xs" style="font-size: 75%; margin-top:3.25em">