mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-24 15:16:44 -06:00
良い感じに
This commit is contained in:
parent
4153b0db38
commit
8dc9ec06f8
13 changed files with 16 additions and 13419 deletions
1219
locales/ca.yml
1219
locales/ca.yml
File diff suppressed because it is too large
Load diff
1219
locales/de.yml
1219
locales/de.yml
File diff suppressed because it is too large
Load diff
1219
locales/en.yml
1219
locales/en.yml
File diff suppressed because it is too large
Load diff
1219
locales/es.yml
1219
locales/es.yml
File diff suppressed because it is too large
Load diff
1219
locales/fr.yml
1219
locales/fr.yml
File diff suppressed because it is too large
Load diff
|
@ -11,13 +11,13 @@ const loadLang = lang => yaml.safeLoad(
|
|||
const native = loadLang('ja-JP');
|
||||
|
||||
const langs = {
|
||||
'de': loadLang('de'),
|
||||
'en': loadLang('en'),
|
||||
'fr': loadLang('fr'),
|
||||
'ja': native,
|
||||
'de-DE': loadLang('de-DE'),
|
||||
'en-US': loadLang('en-US'),
|
||||
'fr-FR': loadLang('fr-FR'),
|
||||
'ja-JP': native,
|
||||
'ja-KS': loadLang('ja-KS'),
|
||||
'pl': loadLang('pl'),
|
||||
'es': loadLang('es')
|
||||
'pl-PL': loadLang('pl-PL'),
|
||||
'es-ES': loadLang('es-ES')
|
||||
};
|
||||
|
||||
Object.values(langs).forEach(locale => {
|
||||
|
|
1219
locales/it.yml
1219
locales/it.yml
File diff suppressed because it is too large
Load diff
1219
locales/ko.yml
1219
locales/ko.yml
File diff suppressed because it is too large
Load diff
1219
locales/pl.yml
1219
locales/pl.yml
File diff suppressed because it is too large
Load diff
1219
locales/pt.yml
1219
locales/pt.yml
File diff suppressed because it is too large
Load diff
1219
locales/ru.yml
1219
locales/ru.yml
File diff suppressed because it is too large
Load diff
1219
locales/zh.yml
1219
locales/zh.yml
File diff suppressed because it is too large
Load diff
|
@ -38,12 +38,18 @@
|
|||
//#endregion
|
||||
|
||||
//#region Detect the user language
|
||||
let lang = navigator.language;
|
||||
let lang = null;
|
||||
|
||||
if (!LANGS.includes(lang)) lang = lang.split('-')[0];
|
||||
if (LANGS.includes(navigator.language)) {
|
||||
lang = navigator.language;
|
||||
} else {
|
||||
lang = LANGS.find(x => x.split('-')[0] == lang);
|
||||
|
||||
// The default language is English
|
||||
if (!LANGS.includes(lang)) lang = 'en';
|
||||
if (lang == null) {
|
||||
// Fallback
|
||||
lang = 'en-US';
|
||||
}
|
||||
}
|
||||
|
||||
if (settings) {
|
||||
if (settings.device.lang) lang = settings.device.lang;
|
||||
|
|
Loading…
Reference in a new issue