fix: intl

This commit is contained in:
弱冠 2020-05-07 14:56:06 +08:00
parent 6b91535740
commit 8a061ab847
2 changed files with 5 additions and 4 deletions

View File

@ -49,13 +49,14 @@ class AliGlobalLocale {
}
} else if (g_config) {
if (g_config.locale) {
return languageMap[g_config.locale] || (g_config.locale || '').replace('_', '-');
return languageMap[g_config.locale] || g_config.locale.replace('_', '-');
}
}
let locale: string = '';
if (navigator.language) {
locale = (navigator.language as string).replace('_', '-');
const lang = (navigator.language as string);
return languageMap[lang] || lang.replace('_', '-');
}
// IE10 及更低版本使用 browserLanguage

View File

@ -1,12 +1,12 @@
import Pane from './views/pane';
import { IconOutline } from './icons/outline';
import { intl } from './locale';
import { intlNode } from './locale';
export default {
name: 'outline-pane',
props: {
icon: IconOutline,
description: intl('Outline Tree'),
description: intlNode('Outline Tree'),
},
content: Pane,
};