From 75d35b5965542bb77c03999fed0e6663cbdd8a27 Mon Sep 17 00:00:00 2001 From: shentao999 Date: Tue, 2 Apr 2019 09:29:10 +0800 Subject: [PATCH] Modify html label to support multi-language Change-Id: I080a1abce7daeebab1a1c3ab01c6ad9af94e13ed Issue-ID: PORTAL-377 Signed-off-by: shentao999 --- ecomp-portal-FE-os/client/index.html | 4 ++++ ecomp-portal-FE-os/client/src/app.js | 12 +++++++++--- .../client/src/views/applications/applications.tpl.html | 4 ++-- .../client/src/views/functionalMenu/functionalMenu.tpl.html | 4 ++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ecomp-portal-FE-os/client/index.html b/ecomp-portal-FE-os/client/index.html index 14a36033..648174e4 100644 --- a/ecomp-portal-FE-os/client/index.html +++ b/ecomp-portal-FE-os/client/index.html @@ -206,6 +206,8 @@ + + @@ -229,6 +231,7 @@ + @@ -255,6 +258,7 @@ + diff --git a/ecomp-portal-FE-os/client/src/app.js b/ecomp-portal-FE-os/client/src/app.js index ec531846..c60dfe9a 100644 --- a/ecomp-portal-FE-os/client/src/app.js +++ b/ecomp-portal-FE-os/client/src/app.js @@ -53,13 +53,19 @@ var app = angular.module('ecompApp', [ 'ui.bootstrap', 'ngMaterial', 'oc.lazyLoad', - 'b2b.att' + 'b2b.att', + 'pascalprecht.translate' ]) - .config(($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider, ngDialogProvider, $controllerProvider, hammerDefaultOptsProvider, $sanitizeProvider) => { + .config(($stateProvider, $translateProvider, $urlRouterProvider, $locationProvider, $httpProvider, ngDialogProvider, $controllerProvider, hammerDefaultOptsProvider) => { app.controllerProvider = $controllerProvider; $urlRouterProvider.otherwise('/error404'); $locationProvider.html5Mode(true); - + var lang = window.localStorage.lang||'EN'; + $translateProvider.preferredLanguage(lang); + $translateProvider.useStaticFilesLoader({ + prefix: '././assets/i18n/', + suffix: '.json' + }) //initialize get if not there if (!$httpProvider.defaults.headers.get) { $httpProvider.defaults.headers.get = {}; diff --git a/ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html b/ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html index 316bc13a..aaba92bf 100644 --- a/ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html +++ b/ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html @@ -40,7 +40,7 @@
-

Application Onboarding

+

{{'Application Onboarding'|T}}

@@ -50,7 +50,7 @@
- +
diff --git a/ecomp-portal-FE-os/client/src/views/functionalMenu/functionalMenu.tpl.html b/ecomp-portal-FE-os/client/src/views/functionalMenu/functionalMenu.tpl.html index 538ac4e7..669cf9f5 100644 --- a/ecomp-portal-FE-os/client/src/views/functionalMenu/functionalMenu.tpl.html +++ b/ecomp-portal-FE-os/client/src/views/functionalMenu/functionalMenu.tpl.html @@ -38,7 +38,7 @@
-

Edit Functional Menu

+

{{'Edit Functional Menu'|T}}

@@ -57,7 +57,7 @@
- + Click when you are done with your changes
-- 2.16.6