enhance(locales): default to ko-KR

This commit is contained in:
オスカー、 2024-06-21 15:34:01 +09:00
parent 621d08540b
commit 094d48c271
Signed by: SWREI
GPG Key ID: 139D6573F92DA9F7
5 changed files with 6 additions and 6 deletions

View File

@ -43,7 +43,7 @@
lang = supportedLangs.find(x => x.split('-')[0] === navigator.language);
// Fallback
if (lang == null) lang = 'en-US';
if (lang == null) lang = 'ko-KR';
}
}
@ -70,7 +70,7 @@
// for https://github.com/misskey-dev/misskey/issues/10202
if (lang == null || lang.toString == null || lang.toString() === 'null') {
console.error('invalid lang value detected!!!', typeof lang, lang);
lang = 'en-US';
lang = 'ko-KR';
}
const localRes = await window.fetch(`/assets/locales/${lang}.${v}.json`);

View File

@ -33,7 +33,7 @@ async function main() {
lang = supportedLangs.find(x => x.split('-')[0] === navigator.language);
// Fallback
if (lang == null) lang = 'en-US';
if (lang == null) lang = 'ko-KR';
}
}

View File

@ -13,7 +13,7 @@ export const hostname = address.hostname;
export const url = address.origin;
export const apiUrl = location.origin + '/api';
export const wsOrigin = location.origin;
export const lang = miLocalStorage.getItem('lang') ?? 'en-US';
export const lang = miLocalStorage.getItem('lang') ?? 'ko-KR';
export const langs = _LANGS_;
const preParseLocale = miLocalStorage.getItem('locale');
export let locale = preParseLocale ? JSON.parse(preParseLocale) : null;

View File

@ -12,7 +12,7 @@ fetchMocker.enableMocks();
// Set i18n
import locales from '../../../locales/index.js';
import { updateI18n } from '@/i18n.js';
updateI18n(locales['en-US']);
updateI18n(locales['ko-KR']);
// XXX: misskey-js panics if WebSocket is not defined
vi.stubGlobal('WebSocket', class WebSocket extends EventTarget { static CLOSING = 2; });

View File

@ -13,7 +13,7 @@ class SwLang {
public cacheName = `mk-cache-${_VERSION_}`;
public lang: Promise<string> = get('lang').then(async prelang => {
if (!prelang) return 'en-US';
if (!prelang) return 'ko-KR';
return prelang;
});