mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
fix i18n error
This commit is contained in:
parent
c20a70e3a6
commit
bed595f055
@ -637,13 +637,13 @@ const LANGUAGES = {
|
||||
flag: '🇩🇪',
|
||||
title: 'German',
|
||||
},
|
||||
zh_hans: {
|
||||
zh_cn: {
|
||||
flag: '🇨🇳',
|
||||
title: '简体中文',
|
||||
title: '中文(中国)',
|
||||
},
|
||||
zh_hant: {
|
||||
zh_tw: {
|
||||
flag: '🇹🇼',
|
||||
title: '繁體中文',
|
||||
title: '中文(台湾)',
|
||||
},
|
||||
fr: {
|
||||
flag: '🇫🇷',
|
||||
@ -670,6 +670,11 @@ const LANGUAGES = {
|
||||
function getLangInfo(locale) {
|
||||
let res = LANGUAGES[locale];
|
||||
|
||||
// failback short i18n
|
||||
if (!res) {
|
||||
res = LANGUAGES[locale.split('_')[0]];
|
||||
}
|
||||
|
||||
if (!res) {
|
||||
res = LANGUAGES.en;
|
||||
}
|
||||
@ -678,7 +683,7 @@ function getLangInfo(locale) {
|
||||
}
|
||||
|
||||
function getSystemLang() {
|
||||
const locale = navigator.language.split('-')[0];
|
||||
const locale = navigator.language.replace('-', '_').toLocaleLowerCase();
|
||||
|
||||
return getLangInfo(locale || 'en');
|
||||
}
|
||||
|
@ -137,6 +137,7 @@ export default {
|
||||
duration: '说明',
|
||||
stop: '停止',
|
||||
forceStop: '强制删除',
|
||||
confirmTask: '确认',
|
||||
deleteTeamMember: '删除团队成员',
|
||||
team2: '团队',
|
||||
newTeamMember: '新增团队成员',
|
@ -137,6 +137,7 @@ export default {
|
||||
duration: '說明',
|
||||
stop: '停止',
|
||||
forceStop: '強制刪除',
|
||||
confirmTask: '确认',
|
||||
deleteTeamMember: '刪除團隊成員',
|
||||
team2: '團隊',
|
||||
newTeamMember: '新增團隊成員',
|
@ -7,7 +7,7 @@ Vue.use(VueI18n);
|
||||
let locale = localStorage.getItem('lang');
|
||||
|
||||
if (!locale) {
|
||||
locale = navigator.language.split('-')[0];
|
||||
locale = navigator.language.replace('-', '_').toLocaleLowerCase();
|
||||
}
|
||||
|
||||
export default new VueI18n({
|
||||
|
Loading…
Reference in New Issue
Block a user