Updated strings for i18n

This commit is contained in:
Ken Hoes 2017-01-30 14:50:56 -05:00
parent 7ae7205f99
commit f33433687b
4 changed files with 17 additions and 10 deletions

View File

@ -1,6 +1,6 @@
<div class="Section-messageBar" ng-if="vm.show_auditor_bar">
<i class="fa fa-warning"></i>
System auditors have read-only permissions in this section.
<span translate>System auditors have read-only permissions in this section.</span>
<button class="Section-messageBar--close" ng-click="vm.closeMessageBar()"><i class="fa fa-times-circle"></i></button>
</div>

View File

@ -6,6 +6,7 @@
import {templateUrl} from '../shared/template-url/template-url.factory';
import ConfigurationController from './configuration.controller';
import { N_ } from '../i18n';
// Import form controllers
import ConfigurationAuthController from './auth-form/configuration-auth.controller';

View File

@ -128,7 +128,13 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'JobsHelper'])
// Accepts image and returns base64 information with basic validation
// Can eventually expand to handle all uploads with different endpoints and handlers
//
.directive('imageUpload', ['ConfigurationUtils', function(ConfigurationUtils) {
.directive('imageUpload', ['ConfigurationUtils', 'i18n',
function(ConfigurationUtils, i18n) {
var browseText = i18n._('BROWSE'),
placeholderText = i18n._('Choose file'),
uploadedText = i18n._('Custom logo has been uploaded'),
removeText = i18n._('REMOVE');
return {
restrict: 'E',
scope: {
@ -136,13 +142,13 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'JobsHelper'])
},
template: `
<div class="input-group">
<label class="input-group-addon Form-filePicker--pickerButton" id="filePickerButton" for="filePicker" ng-click="update($event)">BROWSE</label>
<input type="text" class="form-control Form-filePicker--textBox" id="filePickerText" placeholder="Choose file" readonly>
<label class="input-group-addon Form-filePicker--pickerButton" id="filePickerButton" for="filePicker" ng-click="update($event)">${browseText}</label>
<input type="text" class="form-control Form-filePicker--textBox" id="filePickerText" placeholder="${placeholderText}" readonly>
<input type="file" name="file" class="Form-filePicker" id="filePicker" onchange="angular.element(this).scope().fileChange(this.files)"/>
</div>
<!-- Update when API supports file name saving
<div ng-if="imagePresent" class="Form-filePicker--selectedFile">
Custom logo has been uploaded.
${uploadedText}
</div>-->
<!-- Thumbnail feature
<div class="thumbnail">
@ -161,12 +167,11 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'JobsHelper'])
scope.$on('loginUpdated', function() {
scope.imagePresent = global.$AnsibleConfig.custom_logo;
});
scope.update = function(e) {
if(scope.$parent[fieldKey]) {
e.preventDefault();
scope.$parent[fieldKey] = '';
filePickerButton.html('BROWSE');
filePickerButton.html(browseText);
filePickerText.val('');
}
else {
@ -181,7 +186,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'JobsHelper'])
.then(function(result) {
scope.$parent[fieldKey] = result;
filePickerText.val(file[0].name);
filePickerButton.html('REMOVE');
filePickerButton.html(removeText);
}).catch(function(error) {
filePickerText.html(file[0].name);
filePickerError.text(error);

View File

@ -678,7 +678,8 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
if(field.reset && !field.disabled) {
var resetValue = "'" + field.reset+ "'";
html+= `<a class="Form-resetValue" ng-click="resetValue(${resetValue})">` + i18n._("Reset") + `</a>`;
var resetMessage = i18n._('Reset');
html+= `<a class="Form-resetValue" ng-click="resetValue(${resetValue})">${resetMessage}</a>`;
}
html += "\n\t</label>\n";
@ -1271,7 +1272,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
for (i = 0; i < field.options.length; i++) {
html += "<label class=\"radio-inline ";
html += (field.options[i].labelClass) ? ` ${field.options[i].labelClass} "` : "\"";
html += (field.options[i].labelClass) ? ` ${field.options[i].labelClass} "` : "\"";
html += (field.options[i].ngShow) ? this.attr(field.options[i], 'ngShow') : "";
html += ">";
html += "<input type=\"radio\" ";