Skip to content

Commit

Permalink
feat: tweak i18n (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng authored Dec 2, 2022
1 parent 3d6f80e commit 6ddbcc1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions view/src/locale/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import locale from 'easy-i18n-cli/src/web/locale';
import en from './en-US';

const language = window.localStorage.RELIABLE_LANGUAGE || window.navigator.language;
window.__i18n = window.__i18n || function (key) {
if (language.startsWith('zh')) {
return key;
}
return en[key];
};
window.__i18n = window.__i18n || locale({
en,
getLanguage() {
return window.localStorage.RELIABLE_LANGUAGE || window.navigator.language;
},
});

0 comments on commit 6ddbcc1

Please sign in to comment.