From e13e8179844a9f36ca5f315b0b1d7d0f3d8ad558 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Mon, 20 Feb 2017 15:57:52 -0500 Subject: [PATCH] mark i18n strings for the inventory host form see: #5453 --- awx/ui/client/src/forms/Hosts.js | 49 +++++++++++++++++++------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/awx/ui/client/src/forms/Hosts.js b/awx/ui/client/src/forms/Hosts.js index f52a640e83..21b6ba594c 100644 --- a/awx/ui/client/src/forms/Hosts.js +++ b/awx/ui/client/src/forms/Hosts.js @@ -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,55 @@ export default class: 'Form-header-field', ngClick: 'toggleHostEnabled(host)', type: 'toggle', - awToolTip: "

Indicates if a host is available and should be included in running jobs.

For hosts that " + - "are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.

", - dataTitle: 'Host Enabled', + awToolTip: "

" + + i18n._("Indicates if a host is available and should be included in running jobs.") + + "

" + + i18n._("For hosts that are part of an external" + + " inventory, this flag cannot be changed. It will be" + + " set by the inventory sync process.") + + "

", + dataTitle: i18n._('Host Enabled'), } }, fields: { name: { - label: 'Host Name', + label: i18n._('Host Name'), type: 'text', required: true, - awPopOver: "

Provide a host name, ip address, or ip address:port. Examples include:

" + + awPopOver: "

" + + i18n._("Provide a host name, ip address, or ip address:port. Examples include:") + + "

" + "
myserver.domain.com
" + "127.0.0.1
" + "10.1.0.140:25
" + "server.example.com:25" + "
", - 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: "

Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.

" + - "JSON:
\n" + - "
{
 \"somevar\": \"somevalue\",
 \"password\": \"magic\"
}
\n" + - "YAML:
\n" + - "
---
somevar: somevalue
password: magic
\n" + - '

View JSON examples at www.json.org

' + - '

View YAML examples at docs.ansible.com

', - dataTitle: 'Host Variables', + awPopOver: "

" + + i18n._("Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.") + + "

" + + "JSON:
\n" + + "
{
 \"somevar\": \"somevalue\",
 \"password\": \"magic\"
}
\n" + + "YAML:
\n" + + "
---
somevar: somevalue
password: magic
\n" + + '

View JSON examples at www.json.org

' + + '

View YAML examples at docs.ansible.com

', + dataTitle: i18n._('Host Variables'), dataPlacement: 'right', dataContainer: 'body' }, @@ -92,4 +102,5 @@ export default ngShow: '(host.summary_fields.user_capabilities.edit || canAdd)' } }, - }); + }; + }]);