提交 e26a2ada 编写于 作者: A Atanas Mirchev 提交者: Sebastian Florek

Localization of Error, Events page, Logs page (#859)

上级 998a9d41
......@@ -447,4 +447,16 @@
<translation id="6034749132141636798" key="MSG_NODE_DETAIL_CAPACITY_VALUE" source="/home/maciaszczykm/workspace/dashboard/.tmp/serve/app-dev.js" desc="Value for node 'Capacity' displayed on its details page."><ph name="CPU_CAPACITY" /> cores, <ph name="MEMORY_CAPACITY" />B, <ph name="POD_CAPACITY" /> pods</translation>
<translation id="5574079475783065419" key="MSG_RESOURCE_CARD_LIST_PAGINATION_ROW_SELECTOR_LABEL" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label for pagination rows selector visible on resource lists.">Rows per page</translation>
<translation id="7411749562301043286" key="MSG_NODE_DETAIL_EVENTS_LABEL" source="/home/maciaszczykm/workspace/dashboard/.tmp/serve/app-dev.js" desc="Label 'Events' for the pods tab on the node details page.">Events</translation>
<translation id="7320935166128929457" key="MSG_ERROR_UKNOWN_WARNING" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="This message appears in an error dialog when the returned error code is not recognized.">Unknown Server Error</translation>
<translation id="1376214757414873919" key="MSG_EVENTS_TYPE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Type' for the event type selection box on the events list page.">Type</translation>
<translation id="2063313596570711152" key="MSG_EVENTS_MESSAGE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Message' for the event message column of the events table (events list page).">Message</translation>
<translation id="2123158912770788105" key="MSG_EVENTS_SOURCE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Source' for the event source column of the events table (events list page).">Source</translation>
<translation id="7531239185607897731" key="MSG_EVENTS_SUB_OBJECT_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Sub-object' for the respective column of the events table (events list page).">Sub-object</translation>
<translation id="6413199566846581831" key="MSG_EVENTS_COUNT_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Count' for event count column of the events table (events list page).">Count</translation>
<translation id="2466179008986855362" key="MSG_EVENTS_FIRST_SEEN_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'First seen' for the respective column of the events table (events list page).">First seen</translation>
<translation id="478958642026475488" key="MSG_EVENTS_LAST_SEEN_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Last seen' for the respective column of the events table (events list page).">Last seen</translation>
<translation id="141678852134483176" key="MSG_EVENTS_NO_EVENTS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'No events were found', which appears in the center of the events page when there are no events to display">No events were found</translation>
<translation id="2840024996533597933" key="MSG_EVENTS_NO_EVENTS_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help on the events page when no events are to be displayed.">There are no events to display. It's possible that all of them have expired.</translation>
<translation id="3080875436054465314" key="MSG_LOGS_POD_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pod' on the toolbar of the logs page. Ends with colon.">Pod:</translation>
<translation id="8716485891842363267" key="MSG_LOGS_CONTAINER_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Container' on the toolbar of the logs page. Ends with colon.">Container:</translation>
</translationbundle>
\ No newline at end of file
......@@ -533,4 +533,16 @@
<translation id="6034749132141636798" key="MSG_NODE_DETAIL_CAPACITY_VALUE" source="/home/maciaszczykm/workspace/dashboard/.tmp/serve/app-dev.js" desc="Value for node 'Capacity' displayed on its details page."><ph name="CPU_CAPACITY" /> cores, <ph name="MEMORY_CAPACITY" />B, <ph name="POD_CAPACITY" /> pods</translation>
<translation id="5574079475783065419" key="MSG_RESOURCE_CARD_LIST_PAGINATION_ROW_SELECTOR_LABEL" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label for pagination rows selector visible on resource lists.">Rows per page</translation>
<translation id="7411749562301043286" key="MSG_NODE_DETAIL_EVENTS_LABEL" source="/home/maciaszczykm/workspace/dashboard/.tmp/serve/app-dev.js" desc="Label 'Events' for the pods tab on the node details page.">Events</translation>
<translation id="7320935166128929457" key="MSG_ERROR_UKNOWN_WARNING" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="This message appears in an error dialog when the returned error code is not recognized.">Unknown Server Error</translation>
<translation id="1376214757414873919" key="MSG_EVENTS_TYPE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Type' for the event type selection box on the events list page.">Type</translation>
<translation id="2063313596570711152" key="MSG_EVENTS_MESSAGE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Message' for the event message column of the events table (events list page).">Message</translation>
<translation id="2123158912770788105" key="MSG_EVENTS_SOURCE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Source' for the event source column of the events table (events list page).">Source</translation>
<translation id="7531239185607897731" key="MSG_EVENTS_SUB_OBJECT_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Sub-object' for the respective column of the events table (events list page).">Sub-object</translation>
<translation id="6413199566846581831" key="MSG_EVENTS_COUNT_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Count' for event count column of the events table (events list page).">Count</translation>
<translation id="2466179008986855362" key="MSG_EVENTS_FIRST_SEEN_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'First seen' for the respective column of the events table (events list page).">First seen</translation>
<translation id="478958642026475488" key="MSG_EVENTS_LAST_SEEN_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Last seen' for the respective column of the events table (events list page).">Last seen</translation>
<translation id="141678852134483176" key="MSG_EVENTS_NO_EVENTS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'No events were found', which appears in the center of the events page when there are no events to display">No events were found</translation>
<translation id="2840024996533597933" key="MSG_EVENTS_NO_EVENTS_USER_HELP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="User help on the events page when no events are to be displayed.">There are no events to display. It's possible that all of them have expired.</translation>
<translation id="3080875436054465314" key="MSG_LOGS_POD_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pod' on the toolbar of the logs page. Ends with colon.">Pod:</translation>
<translation id="8716485891842363267" key="MSG_LOGS_CONTAINER_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Container' on the toolbar of the logs page. Ends with colon.">Container:</translation>
</translationbundle>
\ No newline at end of file
......@@ -23,7 +23,7 @@ limitations under the License.
{{ctrl.error.statusText}}
</span>
<span ng-if="::!ctrl.error.statusText">
Unknown Server Error
{{::ctrl.i18n.MSG_ERROR_UKNOWN_WARNING}}
</span>
<span ng-if="::ctrl.showStatus()">
({{ctrl.error.status}})
......
......@@ -23,6 +23,9 @@ export class InternalErrorController {
constructor($stateParams) {
/** @export {!angular.$http.Response} */
this.error = $stateParams.error;
/** @export */
this.i18n = i18n;
}
/**
......@@ -31,3 +34,9 @@ export class InternalErrorController {
*/
showStatus() { return angular.isNumber(this.error.status) && this.error.status > 0; }
}
const i18n = {
/** @export {string} @desc This message appears in an error dialog when the returned error code
is not recognized. */
MSG_ERROR_UKNOWN_WARNING: goog.getMsg('Unknown Server Error'),
};
......@@ -18,7 +18,7 @@ limitations under the License.
<kd-content>
<div class="kd-replicationcontrollerevents-options" layout="row">
<md-input-container>
<label>Type</label>
<label>{{::$ctrl.i18n.MSG_EVENTS_TYPE_LABEL}}</label>
<md-select aria-label="Event Type" ng-model="$ctrl.eventType"
ng-change="$ctrl.handleEventFiltering()"
required>
......@@ -32,15 +32,23 @@ limitations under the License.
<kd-resource-card-list selectable="false" with-statuses="true" ng-if="$ctrl.hasEvents()">
<kd-resource-card-header-columns>
<kd-resource-card-header-column size="medium" grow="4">
Message
{{::$ctrl.i18n.MSG_EVENTS_MESSAGE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column>
{{::$ctrl.i18n.MSG_EVENTS_SOURCE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column>
{{::$ctrl.i18n.MSG_EVENTS_SUB_OBJECT_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column>Source</kd-resource-card-header-column>
<kd-resource-card-header-column>Sub-object</kd-resource-card-header-column>
<kd-resource-card-header-column size="small" grow="nogrow">
Count
{{::$ctrl.i18n.MSG_EVENTS_COUNT_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column>
{{::$ctrl.i18n.MSG_EVENTS_FIRST_SEEN_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column>
{{::$ctrl.i18n.MSG_EVENTS_LAST_SEEN_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column>First seen</kd-resource-card-header-column>
<kd-resource-card-header-column>Last seen</kd-resource-card-header-column>
</kd-resource-card-header-columns>
<kd-resource-card ng-repeat="event in $ctrl.filteredEvents"
......@@ -78,9 +86,9 @@ limitations under the License.
<md-icon class="material-icons kd-replicationcontrollerevents-no-events-icon">
info_outline
</md-icon>
<div class="kd-replicationcontrollerevents-no-events-text">No events were found</div>
<div class="kd-replicationcontrollerevents-no-events-text">{{::$ctrl.i18n.MSG_EVENTS_NO_EVENTS_TITLE}}</div>
<div class="kd-replicationcontrollerevents-no-events-info">
There are no events to display. It's possible that all of them have expired.
{{::$ctrl.i18n.MSG_EVENTS_NO_EVENTS_USER_HELP}}
</div>
</div>
</kd-content>
......
......@@ -38,6 +38,9 @@ export class EventCardListController {
/** @export {string} */
this.eventType = EVENT_ALL;
/** @export */
this.i18n = i18n;
}
/**
......@@ -92,3 +95,27 @@ export const eventCardListComponent = {
'events': '=',
},
};
const i18n = {
/** @export {string} @desc Label 'Type' for the event type selection box on the events list page. */
MSG_EVENTS_TYPE_LABEL: goog.getMsg('Type'),
/** @export {string} @desc Label 'Message' for the event message column of the events table (events list page). */
MSG_EVENTS_MESSAGE_LABEL: goog.getMsg('Message'),
/** @export {string} @desc Label 'Source' for the event source column of the events table (events list page). */
MSG_EVENTS_SOURCE_LABEL: goog.getMsg('Source'),
/** @export {string} @desc Label 'Sub-object' for the respective column of the events table (events list page). */
MSG_EVENTS_SUB_OBJECT_LABEL: goog.getMsg('Sub-object'),
/** @export {string} @desc Label 'Count' for event count column of the events table (events list page). */
MSG_EVENTS_COUNT_LABEL: goog.getMsg('Count'),
/** @export {string} @desc Label 'First seen' for the respective column of the events table (events list page). */
MSG_EVENTS_FIRST_SEEN_LABEL: goog.getMsg('First seen'),
/** @export {string} @desc Label 'Last seen' for the respective column of the events table (events list page). */
MSG_EVENTS_LAST_SEEN_LABEL: goog.getMsg('Last seen'),
/** @export {string} @desc Title 'No events were found', which appears in the center of the events page when
there are no events to display */
MSG_EVENTS_NO_EVENTS_TITLE: goog.getMsg('No events were found'),
/** @export {string} @desc User help on the events page when no events are to be displayed. */
MSG_EVENTS_NO_EVENTS_USER_HELP: goog.getMsg(
`There are no events to display. ` +
`It's possible that all of them have expired.`),
};
......@@ -16,9 +16,9 @@ limitations under the License.
<div layout="row" hide show-gt-sm layout-margin layout-align="center center"
class="kd-logs-toolbar">
<span class="kd-logs-toolbar-text">Pod: {{::ctrl.stateParams.objectName}}</span>
<span class="kd-logs-toolbar-text">{{::ctrl.i18n.MSG_LOGS_POD_LABEL}}</span>
<span class="kd-logs-toolbar-text">Container:</span>
<span class="kd-logs-toolbar-text">{{::ctrl.i18n.MSG_LOGS_CONTAINER_LABEL}}</span>
<md-select class="kd-logs-toolbar-select" aria-label="Containers" ng-model="ctrl.container"
md-on-close="ctrl.onContainerChange(ctrl.container)"
required>
......
......@@ -45,7 +45,11 @@ export default class LogsToolbarController {
/**
* @export {../logs_state.StateParams}
*/
this.stateParams = $stateParams;
/** @export */
this.i18n = i18n;
}
/**
......@@ -126,3 +130,10 @@ export default class LogsToolbarController {
return container;
}
}
const i18n = {
/** @export {string} @desc Label 'Pod' on the toolbar of the logs page. Ends with colon. */
MSG_LOGS_POD_LABEL: goog.getMsg('Pod:'),
/** @export {string} @desc Label 'Container' on the toolbar of the logs page. Ends with colon. */
MSG_LOGS_CONTAINER_LABEL: goog.getMsg('Container:'),
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册