Add Thai language support for various application components

- Introduced Thai translations for dashboard, knowledge, login, models, scripts, settings, skills, task, and common UI elements.
- Updated provider placeholders to include Thai language options.
- Modified locale resolution to support Thai language.
- Adjusted settings store to handle legacy language migration from Japanese to Thai.
- Enhanced runtime types to include Thai as a supported language.
This commit is contained in:
duanshuwen
2026-04-21 19:55:48 +08:00
parent 488d420e06
commit 27dc4af3b4
37 changed files with 1154 additions and 1150 deletions

View File

@@ -82,6 +82,10 @@ function createInitialState(): SettingsState {
let state: SettingsState = createInitialState();
function migrateLegacyLanguageCode(language: string | null | undefined): string | null | undefined {
return language === 'ja' ? 'th' : language;
}
function emit(): void {
for (const listener of listeners) {
listener();
@@ -219,7 +223,7 @@ async function hydrate(): Promise<SettingsState> {
readConfigValue<boolean>(CONFIG_KEYS.GATEWAY_AUTO_START, true),
]);
const resolvedLanguage = resolveSupportedLanguage(language ?? systemLanguage);
const resolvedLanguage = resolveSupportedLanguage(migrateLegacyLanguageCode(language) ?? systemLanguage);
const appliedTheme = applyTheme(themeMode, systemTheme);
patchState({
@@ -265,7 +269,7 @@ async function setThemeMode(themeMode: ThemeMode): Promise<SettingsState> {
}
async function setLanguage(language: string | null | undefined, persist = true): Promise<SettingsState> {
const resolved = resolveSupportedLanguage(language, state.language);
const resolved = resolveSupportedLanguage(migrateLegacyLanguageCode(language), state.language);
if (state.language === resolved && state.initialized) return state;
applyLocale(resolved);