feat(i18n): Add Enterprise Thai (th) localization catalog & integration

This commit is contained in:
Phumiphat Kanjanachotipong
2026-10-27 07:36:03 +00:00
parent b0d1a97bb3
commit f6325e741d
7 changed files with 4585 additions and 3 deletions
+1
View File
@@ -43,6 +43,7 @@ export const LOCALE_LOADERS: Record<string, () => Promise<Messages>> = {
ro: () => import('@/locales/ro/common.json').then((m) => m.default),
ru: () => import('@/locales/ru/common.json').then((m) => m.default),
sk: () => import('@/locales/sk/common.json').then((m) => m.default),
th: () => import('@/locales/th/common.json').then((m) => m.default),
tr: () => import('@/locales/tr/common.json').then((m) => m.default),
uk: () => import('@/locales/uk/common.json').then((m) => m.default),
zh: () => import('@/locales/zh/common.json').then((m) => m.default),
+5
View File
@@ -131,6 +131,10 @@ function FlagEE(props: FlagProps) {
return <Flag {...props}><path fill="#0072CE" d="M32 5H4C1.791 5 0 6.791 0 9v4.667h36V9c0-2.209-1.791-4-4-4z" /><path fill="#141414" d="M0 13.667h36v8.667H0z" /><path fill="#EEE" d="M0 27c0 2.209 1.791 4 4 4h28c2.209 0 4-1.791 4-4v-4.667H0V27z" /></Flag>;
}
function FlagTH(props: FlagProps) {
return <Flag {...props}><path fill="#A7122D" d="M0 26.518V27c0 2.209 1.791 4 4 4h28c2.209 0 4-1.791 4-4v-.482H0z" /><path fill="#EEE" d="M0 22.181h36v4.485H0z" /><path fill="#292648" d="M0 13.513h36v8.821H0z" /><path fill="#EEE" d="M0 9.181h36v4.485H0z" /><path fill="#A7122D" d="M0 9.333V9c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v.333H0z" /></Flag>;
}
export const flagComponents: Record<string, (props: FlagProps) => ReactElement> = {
ar: FlagAE,
ca: FlagCAT,
@@ -152,6 +156,7 @@ export const flagComponents: Record<string, (props: FlagProps) => ReactElement>
pl: FlagPL,
pt: FlagBR,
ro: FlagRO,
th: FlagTH,
tr: FlagTR,
ru: FlagRU,
uk: FlagUA,
+1
View File
@@ -30,6 +30,7 @@ const languages = [
{ value: 'pl', label: 'Polski' },
{ value: 'pt', label: 'Português' },
{ value: 'ro', label: 'Română' },
{ value: 'th', label: 'ไทย' },
{ value: 'tr', label: 'Türkçe' },
{ value: 'ru', label: 'Русский' },
{ value: 'uk', label: 'Українська' },
+3
View File
@@ -91,6 +91,9 @@ export default getRequestConfig(async ({ requestLocale }) => {
case 'sk':
messages = (await import('../locales/sk/common.json')).default;
break;
case 'th':
messages = (await import('../locales/th/common.json')).default;
break;
case 'tr':
messages = (await import('../locales/tr/common.json')).default;
break;
+1 -1
View File
@@ -12,7 +12,7 @@ const localePrefix = (process.env.NEXT_PUBLIC_LOCALE_PREFIX ?? 'never') as
| 'always'
| 'as-needed';
const SUPPORTED_LOCALES = ['ar', 'ca', 'cs', 'da', 'de', 'en', 'es', 'et', 'fa', 'fr', 'he', 'hu', 'it', 'ja', 'ko', 'lv', 'mn', 'nb', 'nl', 'pl', 'pt', 'ro', 'ru', 'sk', 'tr', 'uk', 'zh', 'zh-TW'] as const;
const SUPPORTED_LOCALES = ['ar', 'ca', 'cs', 'da', 'de', 'en', 'es', 'et', 'fa', 'fr', 'he', 'hu', 'it', 'ja', 'ko', 'lv', 'mn', 'nb', 'nl', 'pl', 'pt', 'ro', 'ru', 'sk', 'th', 'tr', 'uk', 'zh', 'zh-TW'] as const;
// Fallback locale used when the visitor's Accept-Language header does not
// match any supported locale (and no NEXT_LOCALE cookie is set yet). Admins
+2 -2
View File
@@ -14,8 +14,8 @@ describe('permission texts', () => {
const shown = ALL_PERMISSIONS.filter((p) => !implicit.has(p));
const langs = readdirSync(LOCALES).filter((l) => !l.includes('.'));
it('covers all 28 locales', () => {
expect(langs).toHaveLength(28);
it('covers all 29 locales', () => {
expect(langs).toHaveLength(29);
});
it.each(langs)('has a title and body for every permission in %s', (lang) => {
File diff suppressed because it is too large Load Diff