Skip to content

Commit

Permalink
add Chinese language
Browse files Browse the repository at this point in the history
  • Loading branch information
junehappylove committed May 5, 2017
1 parent f253479 commit 1eb3c9b
Show file tree
Hide file tree
Showing 5 changed files with 796 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.toDelete
output/**
*.class
*~
Expand Down
5 changes: 5 additions & 0 deletions ui/src/app/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import injectTapEventPlugin from 'react-tap-event-plugin';
import UrlHandler from './url.handler';
import addLocaleKorean from './locale/locale.constant-ko';
import addLocaleChinese from './locale/locale.constant-zh';

/* eslint-disable import/no-unresolved, import/default */

Expand Down Expand Up @@ -50,11 +51,15 @@ export default function AppConfig($provide,
$translateProvider.addInterpolation('$translateMessageFormatInterpolation');

addLocaleKorean(locales);
addLocaleChinese(locales);
var $window = angular.injector(['ng']).get('$window');
var lang = $window.navigator.language || $window.navigator.userLanguage;
if (lang === 'ko') {
$translateProvider.useSanitizeValueStrategy(null);
$translateProvider.preferredLanguage('ko_KR');
}else if(lang === 'zh'){
$translateProvider.useSanitizeValueStrategy(null);
$translateProvider.preferredLanguage('zh_CN');
}

for (var langKey in locales) {
Expand Down
3 changes: 2 additions & 1 deletion ui/src/app/locale/locale.constant-ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,8 @@ export default function addLocaleKorean(locales) {
"language": {
"language": "언어",
"en_US": "영어",
"ko_KR": "한글"
"ko_KR": "한글",
"zh_CN": "중국말"
}
};
angular.extend(locales, {'ko_KR': ko_KR});
Expand Down
Loading

0 comments on commit 1eb3c9b

Please sign in to comment.