diff options
author | shentao999 <shentao@chinamobile.com> | 2019-04-02 09:29:10 +0800 |
---|---|---|
committer | shentao999 <shentao@chinamobile.com> | 2019-04-02 09:29:11 +0800 |
commit | 75d35b5965542bb77c03999fed0e6663cbdd8a27 (patch) | |
tree | 484680826bd3a7b950ab2710b4bd1fb6759351f1 /ecomp-portal-FE-os/client/src/app.js | |
parent | 18def1dcb43684553ba04647cfdb6acdaf8bda4d (diff) |
Modify html label to support multi-language
Change-Id: I080a1abce7daeebab1a1c3ab01c6ad9af94e13ed
Issue-ID: PORTAL-377
Signed-off-by: shentao999 <shentao@chinamobile.com>
Diffstat (limited to 'ecomp-portal-FE-os/client/src/app.js')
-rw-r--r-- | ecomp-portal-FE-os/client/src/app.js | 12 |
1 files changed, 9 insertions, 3 deletions
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 = {}; |