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
@@ -3,6 +3,7 @@ import { describe, expect, test } from 'bun:test';
|
||||
import { dict as enDict } from './messages/en';
|
||||
import { dict as esDict } from './messages/es';
|
||||
import { dict as frDict } from './messages/fr';
|
||||
import { dict as jaDict } from './messages/ja';
|
||||
import { dict as koDict } from './messages/ko';
|
||||
import { dict as plDict } from './messages/pl';
|
||||
import { dict as ptBrDict } from './messages/pt-BR';
|
||||
@@ -14,6 +15,7 @@ const localeDictionaries = {
|
||||
en: enDict,
|
||||
fr: frDict,
|
||||
es: esDict,
|
||||
ja: jaDict,
|
||||
'pt-BR': ptBrDict,
|
||||
uk: ukDict,
|
||||
ko: koDict,
|
||||
@@ -23,15 +25,18 @@ const localeDictionaries = {
|
||||
} as const;
|
||||
|
||||
describe('i18n dictionaries', () => {
|
||||
test('french stays in key parity with english', () => {
|
||||
test('all locales stay in key parity with english', () => {
|
||||
const englishKeys = Object.keys(enDict).sort();
|
||||
|
||||
expect(Object.keys(frDict).sort()).toEqual(englishKeys);
|
||||
for (const dictionary of Object.values(localeDictionaries)) {
|
||||
expect(Object.keys(dictionary).sort()).toEqual(englishKeys);
|
||||
}
|
||||
});
|
||||
|
||||
test('all locales expose the french language label key', () => {
|
||||
test('all locales expose language label keys', () => {
|
||||
for (const [, dictionary] of Object.entries(localeDictionaries)) {
|
||||
expect(dictionary['common.language.french']).toBeTruthy();
|
||||
expect(dictionary['common.language.japanese']).toBeTruthy();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user