- 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.
87 lines
2.2 KiB
TypeScript
87 lines
2.2 KiB
TypeScript
import type { LanguageCode } from '../types/runtime';
|
|
|
|
export const SUPPORTED_LANGUAGE_CODES = ['en', 'zh', 'th'] as const satisfies readonly LanguageCode[];
|
|
|
|
export type { LanguageCode };
|
|
|
|
export const SUPPORTED_LANGUAGES = [
|
|
{ code: 'en', label: 'English' },
|
|
{ code: 'zh', label: '中文' },
|
|
{ code: 'th', label: 'ไทย' },
|
|
] as const;
|
|
|
|
export type Namespace =
|
|
| 'common'
|
|
| 'settings'
|
|
| 'chat'
|
|
| 'channels'
|
|
| 'agents'
|
|
| 'skills'
|
|
| 'cron'
|
|
| 'login'
|
|
| 'models'
|
|
| 'knowledge'
|
|
| 'dashboard'
|
|
| 'task'
|
|
| 'scripts';
|
|
|
|
export const NAMESPACES = [
|
|
'common',
|
|
'settings',
|
|
'chat',
|
|
'channels',
|
|
'agents',
|
|
'skills',
|
|
'cron',
|
|
'login',
|
|
'models',
|
|
'knowledge',
|
|
'dashboard',
|
|
'task',
|
|
'scripts',
|
|
] as const satisfies readonly Namespace[];
|
|
|
|
type RootNamespaceConfig = {
|
|
ns: Namespace;
|
|
stripRoot?: boolean;
|
|
};
|
|
|
|
export const ROOT_NAMESPACE_MAP = {
|
|
app: { ns: 'common' },
|
|
window: { ns: 'common' },
|
|
dialog: { ns: 'common' },
|
|
theme: { ns: 'common' },
|
|
language: { ns: 'common' },
|
|
common: { ns: 'common' },
|
|
sidebar: { ns: 'common' },
|
|
settings: { ns: 'settings', stripRoot: true },
|
|
conversation: { ns: 'chat', stripRoot: true },
|
|
channels: { ns: 'channels', stripRoot: true },
|
|
agents: { ns: 'agents', stripRoot: true },
|
|
skills: { ns: 'skills', stripRoot: true },
|
|
cron: { ns: 'cron', stripRoot: true },
|
|
login: { ns: 'login', stripRoot: true },
|
|
models: { ns: 'models', stripRoot: true },
|
|
knowledge: { ns: 'knowledge', stripRoot: true },
|
|
dashboard: { ns: 'dashboard', stripRoot: true },
|
|
home: { ns: 'dashboard', stripRoot: true },
|
|
task: { ns: 'task', stripRoot: true },
|
|
scripts: { ns: 'scripts', stripRoot: true },
|
|
} as const satisfies Record<string, RootNamespaceConfig>;
|
|
|
|
export const MESSAGE_ROOT_EXPORTS = {
|
|
common: ['app', 'window', 'dialog', 'theme', 'language', 'common', 'sidebar'],
|
|
settings: ['settings'],
|
|
chat: ['conversation'],
|
|
channels: ['channels'],
|
|
agents: ['agents'],
|
|
skills: ['skills'],
|
|
cron: ['cron'],
|
|
login: ['login'],
|
|
models: ['models'],
|
|
knowledge: ['knowledge'],
|
|
dashboard: ['dashboard'],
|
|
task: ['task'],
|
|
scripts: ['scripts'],
|
|
} as const satisfies Record<Namespace, readonly string[]>;
|