Merge pull request #5476 from ryanpetrello/fix-5453

mark a variety of host-related strings for i18n
This commit is contained in:
Ryan Petrello
2017-02-20 16:21:17 -05:00
committed by GitHub
5 changed files with 50 additions and 32 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@
* All Rights Reserved
*************************************************/
export default function(){
export default ['i18n', function(i18n){
return {
editTitle: '{{host.name}}',
name: 'host',
@@ -20,47 +20,54 @@ export default function(){
ngClick: 'toggleHostEnabled()',
type: 'toggle',
awToolTip: "<p>Indicates if a host is available and should be included in running jobs.</p><p>For hosts that " +
"are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.</p>",
dataTitle: 'Host Enabled'
awToolTip: "<p>" +
i18n._("Indicates if a host is available and should be included in running jobs.") +
"</p><p>" +
i18n._("For hosts that are part of an external inventory, this" +
" flag cannot be changed. It will be set by the inventory" +
" sync process.") +
"</p>",
dataTitle: i18n._('Host Enabled'),
}
},
fields: {
name: {
label: 'Host Name',
label: i18n._('Host Name'),
type: 'text',
value: '{{name}}',
awPopOver: "<p>Provide a host name, ip address, or ip address:port. Examples include:</p>" +
awPopOver: "<p>" +
i18n._("Provide a host name, ip address, or ip address:port. Examples include:") +
"</p>" +
"<blockquote>myserver.domain.com<br/>" +
"127.0.0.1<br />" +
"10.1.0.140:25<br />" +
"server.example.com:25" +
"</blockquote>",
dataTitle: 'Host Name',
dataTitle: i18n._('Host Name'),
dataPlacement: 'right',
dataContainer: 'body'
},
description: {
label: 'Description',
label: i18n._('Description'),
type: 'text',
},
variables: {
label: 'Variables',
label: i18n._('Variables'),
type: 'textarea',
rows: 6,
class: 'modal-input-xlarge Form-textArea Form-formGroup--fullWidth',
dataTitle: 'Host Variables',
dataTitle: i18n._('Host Variables'),
dataPlacement: 'right',
dataContainer: 'body',
default: '---',
awPopOver: "<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" +
awPopOver: "<p>" + i18n._("Enter inventory variables using either JSON or YAML syntax. Use the radio button to toggle between the two.") + "</p>" +
"JSON:<br />\n" +
"<blockquote>{<br />&emsp;\"somevar\": \"somevalue\",<br />&emsp;\"password\": \"magic\"<br /> }</blockquote>\n" +
"YAML:<br />\n" +
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
'<p>' + i18n.sprintf(i18n._('View JSON examples at %s'), '<a href="http://www.json.org" target="_blank">www.json.org</a>') + '</p>' +
'<p>' + i18n.sprintf(i18n._('View YAML examples at %s'), '<a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a>') + '</p>',
}
},
buttons: {
@@ -73,4 +80,4 @@ export default function(){
}
}
};
}
}];
@@ -10,8 +10,8 @@ export default [ 'i18n', function(i18n){
name: 'hosts',
iterator: 'host',
selectTitle: i18n._('Add Existing Hosts'),
editTitle: 'Hosts',
listTitle: 'Hosts',
editTitle: i18n._('Hosts'),
listTitle: i18n._('Hosts'),
index: false,
hover: true,
well: true,
@@ -33,7 +33,7 @@ export default [ 'i18n', function(i18n){
},
name: {
key: true,
label: 'Name',
label: i18n._('Name'),
columnClass: 'col-lg-5 col-md-5 col-sm-5 col-xs-8 ellipsis List-staticColumnAdjacent',
ngClick: 'editHost(host.id)'
},
+24 -15
View File
@@ -12,9 +12,10 @@
export default
angular.module('HostFormDefinition', [])
.value('HostForm', {
.factory('HostForm', ['i18n', function(i18n) {
return {
addTitle: 'Create Host',
addTitle: i18n._('Create Host'),
editTitle: '{{ host.name }}',
name: 'host',
basePath: 'hosts',
@@ -27,46 +28,53 @@ export default
class: 'Form-header-field',
ngClick: 'toggleHostEnabled(host)',
type: 'toggle',
awToolTip: "<p>Indicates if a host is available and should be included in running jobs.</p><p>For hosts that " +
"are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.</p>",
dataTitle: 'Host Enabled',
awToolTip: "<p>" +
i18n._("Indicates if a host is available and should be included in running jobs.") +
"</p><p>" +
i18n._("For hosts that are part of an external" +
" inventory, this flag cannot be changed. It will be" +
" set by the inventory sync process.") +
"</p>",
dataTitle: i18n._('Host Enabled'),
}
},
fields: {
name: {
label: 'Host Name',
label: i18n._('Host Name'),
type: 'text',
required: true,
awPopOver: "<p>Provide a host name, ip address, or ip address:port. Examples include:</p>" +
awPopOver: "<p>" +
i18n._("Provide a host name, ip address, or ip address:port. Examples include:") +
"</p>" +
"<blockquote>myserver.domain.com<br/>" +
"127.0.0.1<br />" +
"10.1.0.140:25<br />" +
"server.example.com:25" +
"</blockquote>",
dataTitle: 'Host Name',
dataTitle: i18n._('Host Name'),
dataPlacement: 'right',
dataContainer: 'body',
ngDisabled: '!(host.summary_fields.user_capabilities.edit || canAdd)'
},
description: {
label: 'Description',
label: i18n._('Description'),
ngDisabled: '!(host.summary_fields.user_capabilities.edit || canAdd)',
type: 'text'
},
variables: {
label: 'Variables',
label: i18n._('Variables'),
type: 'textarea',
rows: 6,
class: 'Form-formGroup--fullWidth',
"default": "---",
awPopOver: "<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" +
awPopOver: "<p>" + i18n._("Enter inventory variables using either JSON or YAML syntax. Use the radio button to toggle between the two.") + "</p>" +
"JSON:<br />\n" +
"<blockquote>{<br />&emsp;\"somevar\": \"somevalue\",<br />&emsp;\"password\": \"magic\"<br /> }</blockquote>\n" +
"YAML:<br />\n" +
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
dataTitle: 'Host Variables',
'<p>' + i18n.sprintf(i18n._('View JSON examples at %s'), '<a href="http://www.json.org" target="_blank">www.json.org</a>') + '</p>' +
'<p>' + i18n.sprintf(i18n._('View YAML examples at %s'), '<a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a>') + '</p>',
dataTitle: i18n._('Host Variables'),
dataPlacement: 'right',
dataContainer: 'body'
},
@@ -92,4 +100,5 @@ export default
ngShow: '(host.summary_fields.user_capabilities.edit || canAdd)'
}
},
});
};
}]);