From e26a2adac88b178bb7fa867d40d3c98fb5f7a3ca Mon Sep 17 00:00:00 2001 From: Atanas Mirchev Date: Mon, 20 Jun 2016 09:57:23 +0200 Subject: [PATCH] Localization of Error, Events page, Logs page (#859) --- i18n/messages-en.xtb | 12 +++++++++ i18n/messages-ja.xtb | 12 +++++++++ src/app/frontend/error/internalerror.html | 2 +- .../error/internalerror_controller.js | 9 +++++++ src/app/frontend/events/eventcardlist.html | 26 +++++++++++------- .../events/eventcardlist_component.js | 27 +++++++++++++++++++ .../logs/logstoolbar/logstoolbar.html | 4 +-- .../logstoolbar/logstoolbar_controller.js | 11 ++++++++ 8 files changed, 91 insertions(+), 12 deletions(-) diff --git a/i18n/messages-en.xtb b/i18n/messages-en.xtb index 7d6fe4257..638b6b773 100644 --- a/i18n/messages-en.xtb +++ b/i18n/messages-en.xtb @@ -447,4 +447,16 @@ cores, B, pods Rows per page Events + Unknown Server Error + Type + Message + Source + Sub-object + Count + First seen + Last seen + No events were found + There are no events to display. It's possible that all of them have expired. + Pod: + Container: \ No newline at end of file diff --git a/i18n/messages-ja.xtb b/i18n/messages-ja.xtb index cce900c97..67600c297 100644 --- a/i18n/messages-ja.xtb +++ b/i18n/messages-ja.xtb @@ -533,4 +533,16 @@ cores, B, pods Rows per page Events + Unknown Server Error + Type + Message + Source + Sub-object + Count + First seen + Last seen + No events were found + There are no events to display. It's possible that all of them have expired. + Pod: + Container: \ No newline at end of file diff --git a/src/app/frontend/error/internalerror.html b/src/app/frontend/error/internalerror.html index 7aca9ebdd..f84739531 100644 --- a/src/app/frontend/error/internalerror.html +++ b/src/app/frontend/error/internalerror.html @@ -23,7 +23,7 @@ limitations under the License. {{ctrl.error.statusText}} - Unknown Server Error + {{::ctrl.i18n.MSG_ERROR_UKNOWN_WARNING}} ({{ctrl.error.status}}) diff --git a/src/app/frontend/error/internalerror_controller.js b/src/app/frontend/error/internalerror_controller.js index 86d430721..952656c0d 100644 --- a/src/app/frontend/error/internalerror_controller.js +++ b/src/app/frontend/error/internalerror_controller.js @@ -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'), +}; diff --git a/src/app/frontend/events/eventcardlist.html b/src/app/frontend/events/eventcardlist.html index 3324a4e12..14b910f23 100644 --- a/src/app/frontend/events/eventcardlist.html +++ b/src/app/frontend/events/eventcardlist.html @@ -18,7 +18,7 @@ limitations under the License.
- + @@ -32,15 +32,23 @@ limitations under the License. - Message + {{::$ctrl.i18n.MSG_EVENTS_MESSAGE_LABEL}} + + + {{::$ctrl.i18n.MSG_EVENTS_SOURCE_LABEL}} + + + {{::$ctrl.i18n.MSG_EVENTS_SUB_OBJECT_LABEL}} - Source - Sub-object - Count + {{::$ctrl.i18n.MSG_EVENTS_COUNT_LABEL}} + + + {{::$ctrl.i18n.MSG_EVENTS_FIRST_SEEN_LABEL}} + + + {{::$ctrl.i18n.MSG_EVENTS_LAST_SEEN_LABEL}} - First seen - Last seen info_outline -
No events were found
+
{{::$ctrl.i18n.MSG_EVENTS_NO_EVENTS_TITLE}}
- There are no events to display. It's possible that all of them have expired. + {{::$ctrl.i18n.MSG_EVENTS_NO_EVENTS_USER_HELP}}
diff --git a/src/app/frontend/events/eventcardlist_component.js b/src/app/frontend/events/eventcardlist_component.js index 92abcee3c..0acff9d31 100644 --- a/src/app/frontend/events/eventcardlist_component.js +++ b/src/app/frontend/events/eventcardlist_component.js @@ -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.`), +}; diff --git a/src/app/frontend/logs/logstoolbar/logstoolbar.html b/src/app/frontend/logs/logstoolbar/logstoolbar.html index cfd9c76de..aafc5df5f 100644 --- a/src/app/frontend/logs/logstoolbar/logstoolbar.html +++ b/src/app/frontend/logs/logstoolbar/logstoolbar.html @@ -16,9 +16,9 @@ limitations under the License.
- Pod: {{::ctrl.stateParams.objectName}} + {{::ctrl.i18n.MSG_LOGS_POD_LABEL}} - Container: + {{::ctrl.i18n.MSG_LOGS_CONTAINER_LABEL}} diff --git a/src/app/frontend/logs/logstoolbar/logstoolbar_controller.js b/src/app/frontend/logs/logstoolbar/logstoolbar_controller.js index 83ef0f244..1e41c6770 100644 --- a/src/app/frontend/logs/logstoolbar/logstoolbar_controller.js +++ b/src/app/frontend/logs/logstoolbar/logstoolbar_controller.js @@ -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:'), +}; -- GitLab