Skip to content

Commit 139f8e5

Browse files
taimirSebastian Florek
authored andcommitted
Localization of Deploy, EnvVariables and Upload (#777)
Localization of the base deploy page, the environment variables section and the deployment file upload section.
1 parent 45f56f9 commit 139f8e5

File tree

8 files changed

+116
-19
lines changed

8 files changed

+116
-19
lines changed

i18n/messages-en.xtb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,18 @@
6767
<translation id="4426583640675024823" key="MSG_DEPLOY_SETTINGS_RUN_PRIVILEGED_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help for the &quot;Run as privileged&quot; checkbox input on the deploy from settings page.">Processes in privileged containers are equivalent to processes running as root on the host.</translation>
6868
<translation id="7560440547757208994" key="MSG_DEPLOY_SETTINGS_ENV_VARIABLES_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help for the &quot;Environment variables&quot; section on the deploy from settings page.">Environment variables available for use in the container. Values can reference other variables using $(VAR_NAME) syntax.</translation>
6969
<translation id="7026295428726247109" key="MSG_DEPLOY_SETTINGS_NUMBER_OF_PODS_INT_WARNING" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Appears to tell the user that the number of pods on the deploy from settings page must be non-negative or integer.">Number of pods must be a positive integer</translation>
70-
</translationbundle>
70+
<translation id="750172492346654392" key="MSG_DEPLOY_PAGE_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title text which appears on top of the deploy page.">Deploy a Containerized App</translation>
71+
<translation id="4849906879961443302" key="MSG_DEPLOY_SPECIFY_APP_DETAILS_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for a selection option, which the user must click to manually enter the app details on the deploy page.">Specify app details below</translation>
72+
<translation id="6920937028819232874" key="MSG_DEPLOY_FILE_UPLOAD_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for a selection option, which the user must click to upload a YAML/JSON file to deploy from on the deploy page.">Upload a YAML or JSON file</translation>
73+
<translation id="4656327168203960058" key="MSG_DEPLOY_DEPLOY_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The text is put on the 'Deploy' button at the end of the deploy page.">Deploy</translation>
74+
<translation id="7617135492835700793" key="MSG_DEPLOY_CANCEL_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The text is put on the 'Cancel' button at the end of the deploy page.">Cancel</translation>
75+
<translation id="7456160778295272283" key="MSG_DEPLOY_ENV_VARS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title of the Environment Variables section on the deploy page.">Environment variables</translation>
76+
<translation id="6867325046626733190" key="MSG_DEPLOY_ENV_VARS_NAME_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label &quot;Name&quot; which appears as a placeholder for the input of a environment variable name on the deploy page.">Name</translation>
77+
<translation id="2359882648739163069" key="MSG_DEPLOY_ENV_VARS_VALUE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label &quot;Value&quot; which appears as a placeholder for the input of a environment variable value on the deploy page.">Value</translation>
78+
<translation id="4723073728245526722" key="MSG_DEPLOY_ENV_VARS_NAME_PATTERN_WARNING" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Appears when the name of an environment variable on the deploy page does not match the expected pattern.">Variable name must be a valid C identifier.</translation>
79+
<translation id="7464694778149218104" key="MSG_DEPLOY_UPLOAD_FILE_YAML_OR_JSON_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="A 'YAML or JSON file' label, serving as placeholder for an empty file input field on the deploy page.">YAML or JSON file</translation>
80+
<translation id="8189630039232550375" key="MSG_DEPLOY_UPLOAD_FILE_REQUIRED_WARNING" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Appears to tell the user that he/she must upload a YAML or a JSON file on the deploy page.">File is required</translation>
81+
<translation id="3539277368227313625" key="MSG_DEPLOY_UPLOAD_FILE_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help for the YAML/JSON file upload form on the deploy page.">Select a YAML or JSON file, specifying the resources to deploy.</translation>
82+
<translation id="4100105138388508081" key="MSG_DEPLOY_UPLOAD_FILE_LEARN_MORE_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The text is used as a 'Learn more' link text besides the file upload on the deploy page.">Learn more</translation>
83+
<translation id="5372554302338765680" key="MSG_DEPLOY_DASHBOARD_TOUR_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help with a link redirecting to the &quot;Dashboard tour&quot; on the deploy page.">To learn more, <ph name="OPEN_LINK" /> take the Dashboard Tour <ph name="LINK_ICON" /> <ph name="CLOSE_LINK" /></translation>
84+
</translationbundle>

i18n/messages-ja.xtb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,18 @@
6767
<translation id="4426583640675024823" key="MSG_DEPLOY_SETTINGS_RUN_PRIVILEGED_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help for the &quot;Run as privileged&quot; checkbox input on the deploy from settings page.">Processes in privileged containers are equivalent to processes running as root on the host.</translation>
6868
<translation id="7560440547757208994" key="MSG_DEPLOY_SETTINGS_ENV_VARIABLES_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help for the &quot;Environment variables&quot; section on the deploy from settings page.">Environment variables available for use in the container. Values can reference other variables using $(VAR_NAME) syntax.</translation>
6969
<translation id="7026295428726247109" key="MSG_DEPLOY_SETTINGS_NUMBER_OF_PODS_INT_WARNING" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Appears to tell the user that the number of pods on the deploy from settings page must be non-negative or integer.">Number of pods must be a positive integer</translation>
70-
</translationbundle>
70+
<translation id="750172492346654392" key="MSG_DEPLOY_PAGE_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title text which appears on top of the deploy page.">Deploy a Containerized App</translation>
71+
<translation id="4849906879961443302" key="MSG_DEPLOY_SPECIFY_APP_DETAILS_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for a selection option, which the user must click to manually enter the app details on the deploy page.">Specify app details below</translation>
72+
<translation id="6920937028819232874" key="MSG_DEPLOY_FILE_UPLOAD_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Text for a selection option, which the user must click to upload a YAML/JSON file to deploy from on the deploy page.">Upload a YAML or JSON file</translation>
73+
<translation id="4656327168203960058" key="MSG_DEPLOY_DEPLOY_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The text is put on the 'Deploy' button at the end of the deploy page.">Deploy</translation>
74+
<translation id="7617135492835700793" key="MSG_DEPLOY_CANCEL_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The text is put on the 'Cancel' button at the end of the deploy page.">Cancel</translation>
75+
<translation id="7456160778295272283" key="MSG_DEPLOY_ENV_VARS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title of the Environment Variables section on the deploy page.">Environment variables</translation>
76+
<translation id="6867325046626733190" key="MSG_DEPLOY_ENV_VARS_NAME_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label &quot;Name&quot; which appears as a placeholder for the input of a environment variable name on the deploy page.">Name</translation>
77+
<translation id="2359882648739163069" key="MSG_DEPLOY_ENV_VARS_VALUE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label &quot;Value&quot; which appears as a placeholder for the input of a environment variable value on the deploy page.">Value</translation>
78+
<translation id="4723073728245526722" key="MSG_DEPLOY_ENV_VARS_NAME_PATTERN_WARNING" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Appears when the name of an environment variable on the deploy page does not match the expected pattern.">Variable name must be a valid C identifier.</translation>
79+
<translation id="7464694778149218104" key="MSG_DEPLOY_UPLOAD_FILE_YAML_OR_JSON_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="A 'YAML or JSON file' label, serving as placeholder for an empty file input field on the deploy page.">YAML or JSON file</translation>
80+
<translation id="8189630039232550375" key="MSG_DEPLOY_UPLOAD_FILE_REQUIRED_WARNING" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Appears to tell the user that he/she must upload a YAML or a JSON file on the deploy page.">File is required</translation>
81+
<translation id="3539277368227313625" key="MSG_DEPLOY_UPLOAD_FILE_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help for the YAML/JSON file upload form on the deploy page.">Select a YAML or JSON file, specifying the resources to deploy.</translation>
82+
<translation id="4100105138388508081" key="MSG_DEPLOY_UPLOAD_FILE_LEARN_MORE_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The text is used as a 'Learn more' link text besides the file upload on the deploy page.">Learn more</translation>
83+
<translation id="5372554302338765680" key="MSG_DEPLOY_DASHBOARD_TOUR_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help with a link redirecting to the &quot;Dashboard tour&quot; on the deploy page.">To learn more, <ph name="OPEN_LINK" /> take the Dashboard Tour <ph name="LINK_ICON" /> <ph name="CLOSE_LINK" /></translation>
84+
</translationbundle>

src/app/frontend/deploy/deploy.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,20 @@
1616

1717
<div layout="column" layout-padding-gt-md layout-align="center center" flex="auto">
1818
<md-whiteframe class="kd-deploy-whiteframe md-whiteframe-5dp" flex="auto">
19-
<h3 class="md-headline kd-deploy-form-title">Deploy a Containerized App</h3>
19+
<h3 class="md-headline kd-deploy-form-title">{{::ctrl.i18n.MSG_DEPLOY_PAGE_TITLE}}</h3>
2020

2121
<form name="ctrl.deployForm" ng-submit="ctrl.deployBySelection()" novalidate>
2222
<kd-help-section>
2323
<md-radio-group ng-model="ctrl.selection">
2424
<md-radio-button value="Settings" class="md-primary">
25-
Specify app details below
25+
{{::ctrl.i18n.MSG_DEPLOY_SPECIFY_APP_DETAILS_ACTION}}
2626
</md-radio-button>
2727
<md-radio-button value="File" class="md-primary">
28-
Upload a YAML or JSON file
28+
{{::ctrl.i18n.MSG_DEPLOY_FILE_UPLOAD_ACTION}}
2929
</md-radio-button>
3030
</md-radio-group>
3131
<kd-user-help>
32-
To learn more,
33-
<a href="http://kubernetes.io/docs/user-guide/ui/" target="_blank" tabindex="-1">
34-
take the Dashboard Tour <i class="material-icons">open_in_new</i>
35-
</a>
32+
<span ng-bind-html="::ctrl.i18n.MSG_DEPLOY_DASHBOARD_TOUR_USER_HELP"></span>
3633
</kd-user-help>
3734
</kd-help-section>
3835

@@ -47,9 +44,9 @@ <h3 class="md-headline kd-deploy-form-title">Deploy a Containerized App</h3>
4744

4845
<md-button class="md-raised md-primary kd-deploy-submit-button" type="submit"
4946
ng-disabled="ctrl.isDeployDisabled()">
50-
Deploy
47+
{{::ctrl.i18n.MSG_DEPLOY_DEPLOY_ACTION}}
5148
</md-button>
52-
<md-button class="md-raised kd-deploy-cancel-button" ng-click="ctrl.cancel()">Cancel</md-button>
49+
<md-button class="md-raised kd-deploy-cancel-button" ng-click="ctrl.cancel()">{{::ctrl.i18n.MSG_DEPLOY_CANCEL_ACTION}}</md-button>
5350
</form>
5451
</md-whiteframe>
5552
</div>

src/app/frontend/deploy/deploy_controller.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ export default class DeployController {
6161

6262
/** @private {boolean} */
6363
this.isDeployInProgress_ = false;
64+
65+
/**
66+
* @export
67+
* {!Object}
68+
*/
69+
this.i18n = i18n;
6470
}
6571

6672
/**
@@ -87,3 +93,29 @@ export default class DeployController {
8793
*/
8894
cancel() { this.state_.go(replicationcontrollers); }
8995
}
96+
97+
const i18n = {
98+
/** @export {string} @desc Title text which appears on top of the deploy page. */
99+
MSG_DEPLOY_PAGE_TITLE: goog.getMsg('Deploy a Containerized App'),
100+
101+
/** @export {string} @desc Text for a selection option, which the user must click to manually enter the app details on the deploy page. */
102+
MSG_DEPLOY_SPECIFY_APP_DETAILS_ACTION: goog.getMsg('Specify app details below'),
103+
104+
/** @export {string} @desc Text for a selection option, which the user must click to upload a YAML/JSON file to deploy from on the deploy page. */
105+
MSG_DEPLOY_FILE_UPLOAD_ACTION: goog.getMsg('Upload a YAML or JSON file'),
106+
107+
/** @export {string} @desc The text is put on the 'Deploy' button at the end of the deploy page. */
108+
MSG_DEPLOY_DEPLOY_ACTION: goog.getMsg('Deploy'),
109+
110+
/** @export {string} @desc The text is put on the 'Cancel' button at the end of the deploy page. */
111+
MSG_DEPLOY_CANCEL_ACTION: goog.getMsg('Cancel'),
112+
113+
/** @export {string} @desc User help with a link redirecting to the "Dashboard tour" on the deploy page. */
114+
MSG_DEPLOY_DASHBOARD_TOUR_USER_HELP:
115+
goog.getMsg(`To learn more, {$openLink} take the Dashboard Tour {$linkIcon} {$closeLink}`, {
116+
openLink:
117+
`<a href="http://kubernetes.io/docs/user-guide/ui/" target="_blank" tabindex="-1">`,
118+
closeLink: `</a>`,
119+
linkIcon: `<i class="material-icons">open_in_new</i>`,
120+
}),
121+
};

src/app/frontend/deploy/environmentvariables.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
limitations under the License.
1515
-->
1616

17-
<div class="kd-environment-variables-title md-body-2">Environment variables</div>
17+
<div class="kd-environment-variables-title md-body-2">{{::ctrl.i18n.MSG_DEPLOY_ENV_VARS_TITLE}}</div>
1818
<div ng-repeat="variable in ctrl.variables">
1919
<ng-form name="variablesForm" layout="row">
2020
<md-input-container flex="auto" class="kd-deploy-input-row">
21-
<label>Name</label>
21+
<label>{{::ctrl.i18n.MSG_DEPLOY_ENV_VARS_NAME_LABEL}}</label>
2222
<input ng-model="variable.name" name="name" ng-change="ctrl.addVariableIfNeeed()"
2323
ng-pattern="ctrl.namePattern">
2424
<ng-messages for="variablesForm.name.$error" role="alert" multiple>
25-
<ng-message when="pattern">Variable name must be a valid C identifier.</ng-message>
25+
<ng-message when="pattern">{{::ctrl.i18n.MSG_DEPLOY_ENV_VARS_NAME_PATTERN_WARNING}}</ng-message>
2626
</ng-messages>
2727
</md-input-container>
2828
<div flex="5"></div>
2929
<md-input-container flex="auto" class="kd-deploy-input-row">
30-
<label>Value</label>
30+
<label>{{::ctrl.i18n.MSG_DEPLOY_ENV_VARS_VALUE_LABEL}}</label>
3131
<input ng-model="variable.value" name="value">
3232
</md-input-container>
3333
<div flex="10">

src/app/frontend/deploy/environmentvariables_controller.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export class EnvironmentVariablesController {
3232
* @export {!RegExp}
3333
*/
3434
this.namePattern = new RegExp('^[A-Za-z_][A-Za-z0-9_]*$');
35+
36+
/**
37+
* @export
38+
*/
39+
this.i18n = i18n;
3540
}
3641

3742
/**
@@ -70,3 +75,18 @@ export class EnvironmentVariablesController {
7075
*/
7176
isVariableFilled_(variable) { return !!variable.name; }
7277
}
78+
79+
const i18n = {
80+
/** @export {string} @desc Title of the Environment Variables section on the deploy page. */
81+
MSG_DEPLOY_ENV_VARS_TITLE: goog.getMsg(`Environment variables`),
82+
83+
/** @export {string} @desc Label "Name" which appears as a placeholder for the input of a environment variable name on the deploy page. */
84+
MSG_DEPLOY_ENV_VARS_NAME_LABEL: goog.getMsg(`Name`),
85+
86+
/** @export {string} @desc Label "Value" which appears as a placeholder for the input of a environment variable value on the deploy page. */
87+
MSG_DEPLOY_ENV_VARS_VALUE_LABEL: goog.getMsg(`Value`),
88+
89+
/** @export {string} @desc Appears when the name of an environment variable on the deploy page does not match the expected pattern. */
90+
MSG_DEPLOY_ENV_VARS_NAME_PATTERN_WARNING:
91+
goog.getMsg(`Variable name must be a valid C identifier.`),
92+
};

src/app/frontend/deploy/upload.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
<div layout="row" layout-align="space-between start">
1919
<div flex="auto" >
2020
<md-input-container class="md-block" md-is-error="ctrl.isFileNameError()">
21-
<label>YAML or JSON file</label>
21+
<label>{{::ctrl.i18n.MSG_DEPLOY_UPLOAD_FILE_YAML_OR_JSON_LABEL}}</label>
2222
<!--TODO: Browse file on focus doesn't work in Firefox. It is to be investigated.-->
2323
<input ng-model="ctrl.file.name" ng-focus="ctrl.browseFile()" ng-readonly="true" name="fileName" required/>
2424
<ng-messages for="ctrl.form.fileName.$error" role="alert" multiple>
25-
<ng-message when="required">File is required.</ng-message>
25+
<ng-message when="required">{{::ctrl.i18n.MSG_DEPLOY_UPLOAD_FILE_REQUIRED_WARNING}}</ng-message>
2626
</ng-message>
2727
</ng-messages>
2828
</md-input-container>
@@ -37,9 +37,9 @@
3737
<input type="file" class="kd-upload-file-picker" kd-file-reader ng-model="ctrl.file">
3838
</div>
3939
<kd-user-help>
40-
Select a YAML or JSON file, specifying the resources to deploy.
40+
{{::ctrl.i18n.MSG_DEPLOY_UPLOAD_FILE_USER_HELP}}
4141
<a href="http://kubernetes.io/docs/user-guide/deploying-applications/" target="_blank">
42-
Learn more <i class="material-icons">open_in_new</i>
42+
{{::ctrl.i18n.MSG_DEPLOY_UPLOAD_FILE_LEARN_MORE_ACTION}} <i class="material-icons">open_in_new</i>
4343
</a>
4444
</kd-user-help>
4545
</kd-help-section>

src/app/frontend/deploy/upload_controller.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export class UploadController {
3535
* @export {!angular.FormController}
3636
*/
3737
this.form;
38+
39+
/**
40+
* @export
41+
*/
42+
this.i18n = i18n;
3843
}
3944

4045
/**
@@ -72,3 +77,18 @@ export class UploadController {
7277
return this.form.$submitted && fileName.$invalid;
7378
}
7479
}
80+
81+
const i18n = {
82+
/** @export {string} @desc A 'YAML or JSON file' label, serving as placeholder for an empty file input field on the deploy page. */
83+
MSG_DEPLOY_UPLOAD_FILE_YAML_OR_JSON_LABEL: goog.getMsg(`YAML or JSON file`),
84+
85+
/** @export {string} @desc Appears to tell the user that he/she must upload a YAML or a JSON file on the deploy page. */
86+
MSG_DEPLOY_UPLOAD_FILE_REQUIRED_WARNING: goog.getMsg(`File is required`),
87+
88+
/** @export {string} @desc User help for the YAML/JSON file upload form on the deploy page. */
89+
MSG_DEPLOY_UPLOAD_FILE_USER_HELP:
90+
goog.getMsg(`Select a YAML or JSON file, specifying the resources to deploy.`),
91+
92+
/** @export {string} @desc The text is used as a 'Learn more' link text besides the file upload on the deploy page. */
93+
MSG_DEPLOY_UPLOAD_FILE_LEARN_MORE_ACTION: goog.getMsg(`Learn more`),
94+
};

0 commit comments

Comments
 (0)