Add Japanese locale (ja) support (#1810)
* Add Japanese locale (ja) support - New: ja.ts with 2624 UI translation keys - New: ja.settings.ts with 1789 settings translation keys - Registered ja in runtime.ts (Locale type, LOCALES, LOCALE_LABEL_KEYS, normalizeLocale) - Added ja-JP BCP-47 mapping in intl.ts - Added JA_MESSAGES in bootstrap.ts - Added ja to lazy-load dictionary map in store.ts - Updated messages.test.ts with ja dictionary - Added common.language.japanese to all 8 existing locale files * fix(i18n): complete Japanese locale updates * test(i18n): enforce locale key parity * docs: add Japanese documentation --------- Co-authored-by: yuchi0531 <yuchi0531@users.noreply.github.com> Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
yuchi0531
Bohdan Triapitsyn
parent
b384deb812
commit
eb051f969e
@@ -57,7 +57,30 @@ const FR_MESSAGES: BootstrapMessages = {
|
||||
loadingData: (providersText, agentsText) => `Chargement des données (${providersText}, ${agentsText})…`,
|
||||
};
|
||||
|
||||
export const getBootstrapMessages = (locale: Locale): BootstrapMessages => (locale === 'fr' ? FR_MESSAGES : EN_MESSAGES);
|
||||
const JA_MESSAGES: BootstrapMessages = {
|
||||
startingApi: 'OpenCode API を起動中…',
|
||||
initializing: '初期化中…',
|
||||
connecting: '接続中…',
|
||||
connected: '接続完了!',
|
||||
connectionError: '接続エラー',
|
||||
disconnected: '切断されました',
|
||||
reconnecting: '再接続中…',
|
||||
initialDataLoadFailed: 'OpenCode に接続しましたが、初期データの読み込みに失敗しました。',
|
||||
cliNotFound: 'OpenCode CLI が見つかりません。先にインストールしてください。',
|
||||
providersReady: '✓ プロバイダ',
|
||||
providersLoading: '… プロバイダ',
|
||||
agentsReady: '✓ エージェント',
|
||||
agentsLoading: '… エージェント',
|
||||
startingDevServer: (hostLabel) => `Webview 開発サーバーを起動中 (${hostLabel})...`,
|
||||
waitingDevServer: (hostLabel, attempt) => `Webview 開発サーバーを待機中 (${hostLabel})... 試行 ${attempt}`,
|
||||
loadingData: (providersText, agentsText) => `データを読み込み中 (${providersText}, ${agentsText})…`,
|
||||
};
|
||||
|
||||
export const getBootstrapMessages = (locale: Locale): BootstrapMessages => {
|
||||
if (locale === 'fr') return FR_MESSAGES;
|
||||
if (locale === 'ja') return JA_MESSAGES;
|
||||
return EN_MESSAGES;
|
||||
};
|
||||
|
||||
export const readStoredLocaleForBootstrap = (): Locale => {
|
||||
if (typeof window === 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user