提交 f2da9486 编写于 作者: P Piotr Bryk

Merge pull request #796 from taimir/i18n-localize

Localization of common components
......@@ -162,4 +162,24 @@
<translation id="5059373780898524627" key="MSG_EDIT_RESOURCE_DIALOG_CANCEL" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label for cancel button">Cancel</translation>
<translation id="8463528551217463399" key="MSG_EDIT_RESOURCE_DIALOG_UPDATE" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label for update button">Update</translation>
<translation id="6420130406957025720" key="MSG_YAML_EDIT_MENU_LABEL" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label for YAML edit menu item.">View/edit JSON</translation>
<translation id="6783150167357318030" key="MSG_ACTION_BAR_DELETE_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Generic &quot;Delete some resource&quot; tooltip text which appears over the delete icon on the global action bar.">Delete <ph name="RESOURCE_NAME" /></translation>
<translation id="1026802838123065478" key="MSG_LABELS_SHOW_LESS_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip on the &quot;show less&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show less labels</translation>
<translation id="5209220373114744432" key="MSG_LABELS_SHOW_ALL_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip on the &quot;show all&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show all labels</translation>
<translation id="8335819709341770111" key="MSG_RESOURCE_CARD_DELETE_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Action &quot;Delete&quot; (verb), which appears as a menu item on the cards for kubernetes resources.">Delete</translation>
<translation id="3746517187831242937" key="MSG_RESOURCE_CARD_MENU_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip &quot;Actions&quot;, which appears when you hover over the menu icon on any resource card.">Actions</translation>
<translation id="4162582061346784285" key="MSG_ERROR_HANDLING_DIALOG_CLOSE_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Action &quot;Close&quot; which appears at the bottom of any displayed error dialog.">Close</translation>
<translation id="3967360362065546967" key="MSG_TIME_UNIT_SECOND_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single second.">a second</translation>
<translation id="8618830203451501141" key="MSG_TIME_UNIT_SECONDS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many seconds (plural).">seconds</translation>
<translation id="2862280695903347212" key="MSG_TIME_UNIT_MINUTE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single minute.">a minute</translation>
<translation id="7725098717092009563" key="MSG_TIME_UNIT_MINUTES_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many minutes (plural).">minutes</translation>
<translation id="8611920877700991055" key="MSG_TIME_UNIT_HOUR_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single hour.">an hour</translation>
<translation id="2295440708694714218" key="MSG_TIME_UNIT_HOURS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many hours (plural).">hours</translation>
<translation id="3980015737897416585" key="MSG_TIME_UNIT_DAY_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single day.">a day</translation>
<translation id="3921240742330478356" key="MSG_TIME_UNIT_DAYS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many days (plural).">days</translation>
<translation id="3084302841276031195" key="MSG_TIME_UNIT_MONTH_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single month.">a month</translation>
<translation id="2719737891599002397" key="MSG_TIME_UNIT_MONTHS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many months (plural).">months</translation>
<translation id="58035047264145239" key="MSG_TIME_UNIT_YEAR_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single year.">a year</translation>
<translation id="270964281826728358" key="MSG_TIME_UNIT_YEARS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many years (plural).">years</translation>
<translation id="6450429370516938913" key="MSG_TIME_NOT_YET_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label saying that a certain action has not happened yet.">didn't happen yet</translation>
<translation id="3299077321377208801" key="MSG_TIME_NOW_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label saying that a certain action happened just now.">just now</translation>
</translationbundle>
\ No newline at end of file
......@@ -162,4 +162,24 @@
<translation id="5059373780898524627" key="MSG_EDIT_RESOURCE_DIALOG_CANCEL" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label for cancel button">Cancel</translation>
<translation id="8463528551217463399" key="MSG_EDIT_RESOURCE_DIALOG_UPDATE" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label for update button">Update</translation>
<translation id="6420130406957025720" key="MSG_YAML_EDIT_MENU_LABEL" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label for YAML edit menu item.">View/edit JSON</translation>
<translation id="6783150167357318030" key="MSG_ACTION_BAR_DELETE_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Generic &quot;Delete some resource&quot; tooltip text which appears over the delete icon on the global action bar.">Delete <ph name="RESOURCE_NAME" /></translation>
<translation id="1026802838123065478" key="MSG_LABELS_SHOW_LESS_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip on the &quot;show less&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show less labels</translation>
<translation id="5209220373114744432" key="MSG_LABELS_SHOW_ALL_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip on the &quot;show all&quot; button for the labels of any kubernetes resource. Usually appears on the resource details pages.">show all labels</translation>
<translation id="8335819709341770111" key="MSG_RESOURCE_CARD_DELETE_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Action &quot;Delete&quot; (verb), which appears as a menu item on the cards for kubernetes resources.">Delete</translation>
<translation id="3746517187831242937" key="MSG_RESOURCE_CARD_MENU_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip &quot;Actions&quot;, which appears when you hover over the menu icon on any resource card.">Actions</translation>
<translation id="4162582061346784285" key="MSG_ERROR_HANDLING_DIALOG_CLOSE_ACTION" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Action &quot;Close&quot; which appears at the bottom of any displayed error dialog.">Close</translation>
<translation id="3967360362065546967" key="MSG_TIME_UNIT_SECOND_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single second.">a second</translation>
<translation id="8618830203451501141" key="MSG_TIME_UNIT_SECONDS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many seconds (plural).">seconds</translation>
<translation id="2862280695903347212" key="MSG_TIME_UNIT_MINUTE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single minute.">a minute</translation>
<translation id="7725098717092009563" key="MSG_TIME_UNIT_MINUTES_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many minutes (plural).">minutes</translation>
<translation id="8611920877700991055" key="MSG_TIME_UNIT_HOUR_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single hour.">an hour</translation>
<translation id="2295440708694714218" key="MSG_TIME_UNIT_HOURS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many hours (plural).">hours</translation>
<translation id="3980015737897416585" key="MSG_TIME_UNIT_DAY_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single day.">a day</translation>
<translation id="3921240742330478356" key="MSG_TIME_UNIT_DAYS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many days (plural).">days</translation>
<translation id="3084302841276031195" key="MSG_TIME_UNIT_MONTH_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single month.">a month</translation>
<translation id="2719737891599002397" key="MSG_TIME_UNIT_MONTHS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many months (plural).">months</translation>
<translation id="58035047264145239" key="MSG_TIME_UNIT_YEAR_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, a single year.">a year</translation>
<translation id="270964281826728358" key="MSG_TIME_UNIT_YEARS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Time units label, many years (plural).">years</translation>
<translation id="6450429370516938913" key="MSG_TIME_NOT_YET_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label saying that a certain action has not happened yet.">didn't happen yet</translation>
<translation id="3299077321377208801" key="MSG_TIME_NOW_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label saying that a certain action happened just now.">just now</translation>
</translationbundle>
......@@ -17,5 +17,7 @@ limitations under the License.
<md-button ng-class="$ctrl.buttonClasses"
ng-click="$ctrl.remove()">
<md-icon class="kd-actionbar-icon-button">delete</md-icon>
<md-tooltip md-direction="bottom">Delete {{::$ctrl.resourceKindName}}</md-tooltip>
<md-tooltip md-direction="bottom">
{{::$ctrl.getDeleteTooltip()}}
</md-tooltip>
</md-button>
......@@ -60,6 +60,20 @@ export class ActionbarDeleteItemController {
this.state_.go(parentStateName);
});
}
/**
* @export
* @return {string}
*/
getDeleteTooltip() {
/**
* @type {string} @desc Generic "Delete some resource" tooltip text which appears over the
* delete icon on the global action bar.
*/
let MSG_ACTION_BAR_DELETE_TOOLTIP =
goog.getMsg('Delete {$resourceName}', {'resourceName': this.resourceKindName});
return MSG_ACTION_BAR_DELETE_TOOLTIP;
}
}
/**
......
......@@ -20,5 +20,6 @@ limitations under the License.
</kd-middle-ellipsis>
<div class="kd-labels kd-labels-switch" ng-show="labelsCtrl.isMoreAvailable()"
ng-click="labelsCtrl.switchLabelsView()">
{{labelsCtrl.isShowingAll() ? "show less labels" : "show all labels"}}
{{labelsCtrl.isShowingAll() ?
labelsCtrl.i18n.MSG_LABELS_SHOW_LESS_TOOLTIP : labelsCtrl.i18n.MSG_LABELS_SHOW_ALL_TOOLTIP}}
</div>
......@@ -32,6 +32,9 @@ export default class LabelsController {
/** @private {boolean} */
this.isShowingAllLabels_ = false;
/** @export */
this.i18n = i18n;
}
/**
......@@ -67,3 +70,12 @@ export default class LabelsController {
*/
switchLabelsView() { this.isShowingAllLabels_ = !this.isShowingAllLabels_; }
}
const i18n = {
/** @export {string} @desc Tooltip on the "show less" button for the labels of any kubernetes
resource. Usually appears on the resource details pages. */
MSG_LABELS_SHOW_LESS_TOOLTIP: goog.getMsg('show less labels'),
/** @export {string} @desc Tooltip on the "show all" button for the labels of any kubernetes
resource. Usually appears on the resource details pages. */
MSG_LABELS_SHOW_ALL_TOOLTIP: goog.getMsg('show all labels'),
};
......@@ -16,6 +16,6 @@ limitations under the License.
<md-menu-item>
<md-button ng-click="$ctrl.remove()">
Delete
{{::$ctrl.i18n.MSG_RESOURCE_CARD_DELETE_ACTION}}
</md-button>
</md-menu-item>
......@@ -37,6 +37,9 @@ export class ResourceCardDeleteMenuItemController {
/** @private {!ui.router.$state}} */
this.state_ = $state;
/** @export */
this.i18n = i18n;
}
/**
......@@ -67,3 +70,9 @@ export const resourceCardDeleteMenuItemComponent = {
},
controller: ResourceCardDeleteMenuItemController,
};
const i18n = {
/** @export {string} @desc Action "Delete" (verb), which appears as a menu item on the cards for
kubernetes resources. */
MSG_RESOURCE_CARD_DELETE_ACTION: goog.getMsg('Delete'),
};
......@@ -17,7 +17,7 @@ limitations under the License.
<md-menu>
<md-button ng-click="$mdOpenMenu($event)" class="md-icon-button">
<md-icon md-font-library="material-icons">more_vert</md-icon>
<md-tooltip>Actions</md-tooltip>
<md-tooltip>{{::$ctrl.i18n.MSG_RESOURCE_CARD_MENU_TOOLTIP}}</md-tooltip>
</md-button>
<md-menu-content ng-transclude>
</md-menu-content>
......
......@@ -12,6 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Controller for the resource card menu.
* @final
*/
export class ResourceCardMenuController {
constructor() {
/** @export */
this.i18n = i18n;
}
}
/**
* Resource card header columns component. See resource card list for documentation.
* @type {!angular.Component}
......@@ -19,4 +30,11 @@
export const resourceCardMenuComponent = {
templateUrl: 'common/components/resourcecard/resourcecardmenu.html',
transclude: true,
controller: ResourceCardMenuController,
};
const i18n = {
/** @export {string} @desc Tooltip "Actions", which appears when you hover over the menu icon on
any resource card. */
MSG_RESOURCE_CARD_MENU_TOOLTIP: goog.getMsg('Actions'),
};
......@@ -38,7 +38,13 @@ export default class ErrorDialog {
let alert = this.mdDialog_.alert();
alert.title(title);
alert.textContent(text);
alert.ok('Close');
alert.ok(i18n.MSG_ERROR_HANDLING_DIALOG_CLOSE_ACTION);
this.mdDialog_.show(alert);
}
}
const i18n = {
/** @export {string} @desc Action "Close" which appears at the bottom of any displayed error
dialog. */
MSG_ERROR_HANDLING_DIALOG_CLOSE_ACTION: goog.getMsg('Close'),
};
......@@ -12,45 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Unit name constants (singular and plural form), that will be used by the filter.
*
* @enum {!Array<string>}
*/
const Units = {
SECOND: ['a second', 'seconds'],
MINUTE: ['a minute', 'minutes'],
HOUR: ['an hour', 'hours'],
DAY: ['a day', 'days'],
MONTH: ['a month', 'months'],
YEAR: ['a year', 'years'],
};
/**
* Unit conversion constants.
*
* @enum {number}
*/
const UnitConversions = {
MILLISECONDS_PER_SECOND: 1000,
SECONDS_PER_MINUTE: 60,
MINUTES_PER_HOUR: 60,
HOURS_PER_DAY: 24,
DAYS_PER_MONTH: 30,
DAYS_PER_YEAR: 365,
MONTHS_PER_YEAR: 12,
};
/**
* Time constants.
*
* @enum {string}
*/
const TimeConstants = {
NOT_YET: `didn't happen yet`,
NOW: `just now`,
};
/**
* Returns filter function to display relative time since given date.
*
......@@ -134,3 +95,73 @@ function formatOutputTimeString_(timeValue, timeUnit) {
return timeUnit[0];
}
}
const i18n = {
/** @export {string} @desc Time units label, a single second.*/
MSG_TIME_UNIT_SECOND_LABEL: goog.getMsg('a second'),
/** @export {string} @desc Time units label, many seconds (plural).*/
MSG_TIME_UNIT_SECONDS_LABEL: goog.getMsg('seconds'),
/** @export {string} @desc Time units label, a single minute.*/
MSG_TIME_UNIT_MINUTE_LABEL: goog.getMsg('a minute'),
/** @export {string} @desc Time units label, many minutes (plural).*/
MSG_TIME_UNIT_MINUTES_LABEL: goog.getMsg('minutes'),
/** @export {string} @desc Time units label, a single hour.*/
MSG_TIME_UNIT_HOUR_LABEL: goog.getMsg('an hour'),
/** @export {string} @desc Time units label, many hours (plural).*/
MSG_TIME_UNIT_HOURS_LABEL: goog.getMsg('hours'),
/** @export {string} @desc Time units label, a single day.*/
MSG_TIME_UNIT_DAY_LABEL: goog.getMsg('a day'),
/** @export {string} @desc Time units label, many days (plural).*/
MSG_TIME_UNIT_DAYS_LABEL: goog.getMsg('days'),
/** @export {string} @desc Time units label, a single month.*/
MSG_TIME_UNIT_MONTH_LABEL: goog.getMsg('a month'),
/** @export {string} @desc Time units label, many months (plural).*/
MSG_TIME_UNIT_MONTHS_LABEL: goog.getMsg('months'),
/** @export {string} @desc Time units label, a single year.*/
MSG_TIME_UNIT_YEAR_LABEL: goog.getMsg('a year'),
/** @export {string} @desc Time units label, many years (plural).*/
MSG_TIME_UNIT_YEARS_LABEL: goog.getMsg('years'),
/** @export {string} @desc Label saying that a certain action has not happened yet.*/
MSG_TIME_NOT_YET_LABEL: goog.getMsg(`didn't happen yet`),
/** @export {string} @desc Label saying that a certain action happened just now. */
MSG_TIME_NOW_LABEL: goog.getMsg(`just now`),
};
/**
* Unit name constants (singular and plural form), that will be used by the filter.
*
* @enum {!Array<string>}
*/
const Units = {
SECOND: [i18n.MSG_TIME_UNIT_SECOND_LABEL, i18n.MSG_TIME_UNIT_SECONDS_LABEL],
MINUTE: [i18n.MSG_TIME_UNIT_MINUTE_LABEL, i18n.MSG_TIME_UNIT_MINUTES_LABEL],
HOUR: [i18n.MSG_TIME_UNIT_HOUR_LABEL, i18n.MSG_TIME_UNIT_HOURS_LABEL],
DAY: [i18n.MSG_TIME_UNIT_DAY_LABEL, i18n.MSG_TIME_UNIT_DAYS_LABEL],
MONTH: [i18n.MSG_TIME_UNIT_MONTH_LABEL, i18n.MSG_TIME_UNIT_MONTHS_LABEL],
YEAR: [i18n.MSG_TIME_UNIT_YEAR_LABEL, i18n.MSG_TIME_UNIT_YEARS_LABEL],
};
/**
* Unit conversion constants.
*
* @enum {number}
*/
const UnitConversions = {
MILLISECONDS_PER_SECOND: 1000,
SECONDS_PER_MINUTE: 60,
MINUTES_PER_HOUR: 60,
HOURS_PER_DAY: 24,
DAYS_PER_MONTH: 30,
DAYS_PER_YEAR: 365,
MONTHS_PER_YEAR: 12,
};
/**
* Time constants.
*
* @enum {string}
*/
const TimeConstants = {
NOT_YET: i18n.MSG_TIME_NOT_YET_LABEL,
NOW: i18n.MSG_TIME_NOW_LABEL,
};
......@@ -132,7 +132,7 @@ const i18n = {
/** @export {string} @desc The text appears when the namespace name exceeds the maximal length. */
MSG_NAMESPACE_NAME_LENGTH_WARNING:
goog.getMsg('Name must be up to {$maxLength} characters long', {maxLength: '63'}),
goog.getMsg('Name must be up to {$maxLength} characters long', {'maxLength': '63'}),
/** @export {string} @desc Warning which tells the user that the namespace name is required. */
MSG_NAMESPACE_NAME_REQUIRED_WARNING: goog.getMsg('Name is required'),
......
......@@ -106,22 +106,24 @@ const i18n = {
YAML/JSON file to deploy from on the deploy page. */
MSG_DEPLOY_FILE_UPLOAD_ACTION: goog.getMsg('Upload a YAML or JSON file'),
/** @export {string} @desc The text is put on the 'Deploy' button at the end of the deploy page.
/** @export {string} @desc The text is put on the 'Deploy' button at the end of the deploy
* page.
*/
MSG_DEPLOY_DEPLOY_ACTION: goog.getMsg('Deploy'),
/** @export {string} @desc The text is put on the 'Cancel' button at the end of the deploy page.
/** @export {string} @desc The text is put on the 'Cancel' button at the end of the deploy
* page.
*/
MSG_DEPLOY_CANCEL_ACTION: goog.getMsg('Cancel'),
/** @export {string} @desc User help with a link redirecting to the "Dashboard tour" on the deploy
page. */
/** @export {string} @desc User help with a link redirecting to the "Dashboard tour" on the
deploy page. */
MSG_DEPLOY_DASHBOARD_TOUR_USER_HELP: goog.getMsg(
`To learn more, {$openLink} take the Dashboard Tour {$linkIcon} {$closeLink}`,
{
openLink:
'openLink':
`<a href="http://kubernetes.io/docs/user-guide/ui/" target="_blank" tabindex="-1">`,
closeLink: `</a>`,
linkIcon: `<i class="material-icons">open_in_new</i>`,
'closeLink': `</a>`,
'linkIcon': `<i class="material-icons">open_in_new</i>`,
}),
};
......@@ -399,7 +399,7 @@ const i18n = {
MSG_DEPLOY_SETTINGS_APP_NAME_MAX_LENGTH_WARNING:
goog.getMsg(`Name must be up to {$maxLength} characters long.`,
{
maxLength: '24',
'maxLength': '24',
}),
/** @export {string} @desc User help for the `App name` input on the deploy from settings page. */
......
......@@ -22,7 +22,7 @@ limitations under the License.
ng-model-options="{allowInvalid: true}">
<ng-messages for="labelForm.key.$error" ng-if="labelForm.key.$touched && labelForm.key.$invalid">
<ng-message when="unique">
{{labelCtrl.label.key}} {{::labelCtrl.i18n.MSG_DEPLOY_LABEL_KEY_NOT_UNIQUE_WARNING}}
{{::labelCtrl.getLabelKeyUniqueWarning()}}
</ng-message>
<ng-message when="kdValidLabelKeyPrefixPattern">
{{::labelCtrl.i18n.MSG_DEPLOY_LABEL_KEY_PREFIX_PATTERN_WARNING}}
......
......@@ -133,13 +133,21 @@ export default class DeployLabelController {
* @private
*/
isFilled_(label) { return label.key.length !== 0 && label.value().length !== 0; }
/**
* @export
* @return {string}
*/
getLabelKeyUniqueWarning() {
/** @type {string} @desc This warning appears when the key of a specified kubernetes label on
* the deploy page is not unique.*/
let MSG_DEPLOY_LABEL_KEY_NOT_UNIQUE_WARNING =
goog.getMsg('{$labelKey} is not unique.', {'labelKey': this.label.key});
return MSG_DEPLOY_LABEL_KEY_NOT_UNIQUE_WARNING;
}
}
const i18n = {
/** @export {string} @desc This warning appears when the key of a specified kubernetes label
on the deploy page is not unique.*/
MSG_DEPLOY_LABEL_KEY_NOT_UNIQUE_WARNING:
goog.getMsg('{$labelKey} is not unique.', {labelKey: ''}),
/** @export {string} @desc This warning appears when the key of a specified kubernetes label
(on the deploy page) does not start with a proper prefix. */
MSG_DEPLOY_LABEL_KEY_PREFIX_PATTERN_WARNING:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册