* Only go to languages docs supports

* Fix loading chinese for Safari
This commit is contained in:
Vincent Fiduccia 2016-07-25 11:50:14 -07:00 committed by GitHub
parent 81ad9d96cd
commit 325a394fcb
7 changed files with 9 additions and 5 deletions

View File

@ -179,7 +179,7 @@ export default Ember.Service.extend(Ember.Evented, {
docsBase: function() {
let version = this.get(`asMap.${C.SETTING.HELP_VERSION}.value`);
let lang = (this.get('intl._locale')[0]||'').replace(/-.*$/,'');
if ( !lang || lang === 'none' ) {
if ( !lang || lang === 'none' || C.LANGUAGE.DOCS.indexOf(lang) === -1 ) {
lang = 'en';
}

View File

@ -67,7 +67,7 @@ export default Ember.Service.extend({
}).then((resp) => {
let promise;
if ( this.get('app.needIntlPolyfill') ) {
promise = loadScript(`${this.get('app.baseAssets')}assets/intl/locales/${language}.js?${application.version}`);
promise = loadScript(`${this.get('app.baseAssets')}assets/intl/locales/${language.toLowerCase()}.js?${application.version}`);
} else {
promise = Ember.RSVP.resolve();
}
@ -80,6 +80,9 @@ export default Ember.Service.extend({
});
}).catch((err) => {
this.get('growl').fromError('Error loading language: ' + language, err);
if ( language !== C.LANGUAGE.DEFAULT ) {
return this.sideLoadLanguage(C.LANGUAGE.DEFAULT);
}
});
}
},

View File

@ -136,6 +136,7 @@ var C = {
LANGUAGE: {
DEFAULT: 'en-us',
FORMAT_RELATIVE_TIMEOUT: 1000,
DOCS: ['en'],
},
THEME: {

View File

@ -11,4 +11,4 @@ files:
'ja-JP': 'ja-jp'
'pt-BR': 'pt-br'
'ru-RU': 'ru-ru'
'zh-CN': 'zh-Hans-CN'
'zh-CN': 'zh-hans'

View File

@ -1,6 +1,6 @@
{
"name": "ui",
"version": "1.2.3",
"version": "1.2.4",
"private": true,
"directories": {
"doc": "doc",

View File

@ -2821,7 +2821,7 @@ waitKubernetes:
addHost: '1台のホストを追加しています'
activateHost: 'ホストがアクティブになるのを待っています'
createStack: 'Kubernetes のシステムスタックを作成中'
startServices: 'サービスを起動中 ({sub} of {count})'
startServices: 'サービスを起動中'
waitApi: 'Kubernetes API を待っています'
createNamespace: '名前空間を作成中'