i18n: add full Thai translation (th) (#1018)

* i18n: add full Thai translation (th-TH)

* i18n: fix placeholders, update tests and complete documentation for Thai (th)

* i18n: fix placeholders, update tests and complete documentation for Thai locale

* chore: revert unrelated docker deployment changes (fix scope drift)

---------

Co-authored-by: ryu <ryu@example.com>
This commit is contained in:
Tatsuyato 2026-05-09 14:19:47 +07:00 committed by GitHub
parent 13ab430b45
commit f5564c93a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1228 additions and 4 deletions

View file

@ -30,6 +30,7 @@ from `LOCALES`.
| Code | Language | UI dict | Root README | Core docs | Display metadata | Status | | Code | Language | UI dict | Root README | Core docs | Display metadata | Status |
| ------- | -------------------- | ---------------------- | ------------------- | --------- | ---------------- | ------ | | ------- | -------------------- | ---------------------- | ------------------- | --------- | ---------------- | ------ |
| `en` | English | `en.ts` (source) | `README.md` | source | `content.ts` | active | | `en` | English | `en.ts` (source) | `README.md` | source | `content.ts` | active |
| `id` | Bahasa Indonesia | `id.ts` | — | — | — | active |
| `ar` | العربية | `ar.ts` | `README.ar.md` | — | — | active | | `ar` | العربية | `ar.ts` | `README.ar.md` | — | — | active |
| `de` | Deutsch | `de.ts` | `README.de.md` | yes | — | active | | `de` | Deutsch | `de.ts` | `README.de.md` | yes | — | active |
| `es-ES` | Español (España) | `es-ES.ts` | `README.es.md` | — | — | active | | `es-ES` | Español (España) | `es-ES.ts` | `README.es.md` | — | — | active |
@ -45,6 +46,7 @@ from `LOCALES`.
| `fr` | Français | `fr.ts` | `README.fr.md` | yes | `content.fr.ts` | active | | `fr` | Français | `fr.ts` | `README.fr.md` | yes | `content.fr.ts` | active |
| `uk` | Українська | `uk.ts` | `README.uk.md` | — | — | active | | `uk` | Українська | `uk.ts` | `README.uk.md` | — | — | active |
| `tr` | Türkçe | `tr.ts` | `README.tr.md` | — | — | active | | `tr` | Türkçe | `tr.ts` | `README.tr.md` | — | — | active |
| `th` | ภาษาไทย | `th.ts` | — | — | — | active |
> A locale may ship a UI dict, a root README, core docs, display metadata, > A locale may ship a UI dict, a root README, core docs, display metadata,
> or any subset of those surfaces. The English locale is the source of > or any subset of those surfaces. The English locale is the source of

View file

@ -26,6 +26,7 @@ import { hu } from './locales/hu';
import { fr } from './locales/fr'; import { fr } from './locales/fr';
import { uk } from './locales/uk'; import { uk } from './locales/uk';
import { tr } from './locales/tr'; import { tr } from './locales/tr';
import { th } from './locales/th';
import { LOCALES, type Dict, type Locale } from './types'; import { LOCALES, type Dict, type Locale } from './types';
export { LOCALES, LOCALE_LABEL } from './types'; export { LOCALES, LOCALE_LABEL } from './types';
@ -51,6 +52,7 @@ const DICTS: Record<Locale, Dict> = {
'fr': fr, 'fr': fr,
'uk': uk, 'uk': uk,
'tr': tr, 'tr': tr,
'th': th,
}; };
const LS_KEY = 'open-design:locale'; const LS_KEY = 'open-design:locale';

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
// Supported UI locales. Adding a new locale requires creating a new // Supported UI locales. Adding a new locale requires creating a new
// dictionary in `./locales/` and registering it in `./index.tsx`. // dictionary in `./locales/` and registering it in `./index.tsx`.
export type Locale = 'en' | 'id' | 'de' | 'zh-CN' | 'zh-TW' | 'pt-BR' | 'es-ES' | 'ru' | 'fa' | 'ar' | 'ja' | 'ko' | 'pl' | 'hu' | 'fr' | 'uk' | 'tr'; export type Locale = 'en' | 'id' | 'de' | 'zh-CN' | 'zh-TW' | 'pt-BR' | 'es-ES' | 'ru' | 'fa' | 'ar' | 'ja' | 'ko' | 'pl' | 'hu' | 'fr' | 'uk' | 'tr' | 'th';
export const LOCALES: Locale[] = ['en', 'id', 'de', 'zh-CN', 'zh-TW', 'pt-BR', 'es-ES', 'ru', 'fa', 'ar', 'ja', 'ko', 'pl', 'hu', 'fr', 'uk', 'tr']; export const LOCALES: Locale[] = ['en', 'id', 'de', 'zh-CN', 'zh-TW', 'pt-BR', 'es-ES', 'ru', 'fa', 'ar', 'ja', 'ko', 'pl', 'hu', 'fr', 'uk', 'tr', 'th'];
export const LOCALE_LABEL: Record<Locale, string> = { export const LOCALE_LABEL: Record<Locale, string> = {
'en': 'English', 'en': 'English',
@ -21,7 +21,8 @@ export const LOCALE_LABEL: Record<Locale, string> = {
'hu': 'Magyar', 'hu': 'Magyar',
'fr': 'Français', 'fr': 'Français',
'uk': 'Українська', 'uk': 'Українська',
'tr': 'Türkçe' 'tr': 'Türkçe',
'th': 'ภาษาไทย'
}; };
// Translation dictionary shape — flat keys, dot-namespaced. We keep it // Translation dictionary shape — flat keys, dot-namespaced. We keep it

View file

@ -4,7 +4,7 @@ import { en } from '../../src/i18n/locales/en';
import { id } from '../../src/i18n/locales/id'; import { id } from '../../src/i18n/locales/id';
import { LOCALES, LOCALE_LABEL, type Dict, type Locale } from '../../src/i18n/types'; import { LOCALES, LOCALE_LABEL, type Dict, type Locale } from '../../src/i18n/types';
const EXPECTED_LOCALES = ['en', 'id', 'de', 'zh-CN', 'zh-TW', 'pt-BR', 'es-ES', 'ru', 'fa', 'ar', 'ja', 'ko', 'pl', 'hu', 'fr', 'uk', 'tr']; const EXPECTED_LOCALES = ['en', 'id', 'de', 'zh-CN', 'zh-TW', 'pt-BR', 'es-ES', 'ru', 'fa', 'ar', 'ja', 'ko', 'pl', 'hu', 'fr', 'uk', 'tr', 'th'];
function placeholders(value: string): string[] { function placeholders(value: string): string[] {
const names: string[] = []; const names: string[] = [];