refactor: fully typed locales (#13033)

* refactor: fully typed locales

* refactor: hide parameterized locale strings from type data in ts access

* refactor: missing assertions

* docs: annotation
This commit is contained in:
Acid Chicken (硫酸鶏)
2024-01-19 07:58:07 +09:00
committed by GitHub
parent c1019a006b
commit 43401210c3
4 changed files with 383 additions and 165 deletions

View File

@@ -10,6 +10,7 @@ import { I18n } from '@/scripts/i18n.js';
export const i18n = markRaw(new I18n<Locale>(locale));
export function updateI18n(newLocale) {
i18n.ts = newLocale;
export function updateI18n(newLocale: Locale) {
// @ts-expect-error -- private field
i18n.locale = newLocale;
}