Allow use of Dutch translations [ER].

This commit is contained in:
Guido Leenders
2024-11-12 09:45:10 +01:00
parent 5ee809e421
commit b6fdde2f04
7 changed files with 20 additions and 4 deletions
+1
View File
@@ -15,6 +15,7 @@ module.exports = {
'it',
'ja',
'ko',
'nl',
'pt-BR',
'ru',
'th',
-4
View File
@@ -278,10 +278,6 @@
},
"resolutions": {
"@types/react": "^18",
"**/zeed-dom": "0.10.9",
"**/zod": "3.23.8",
"**/expo-constants": "16.0.1",
"**/expo-device": "6.0.2",
"@react-native/babel-preset": "0.74.1",
"@radix-ui/react-focus-scope": "1.1.0"
},
+2
View File
@@ -22,6 +22,7 @@ import {
it,
ja,
ko,
nl,
ptBR,
ru,
th,
@@ -53,6 +54,7 @@ const locales: Record<AppLanguage, Locale | undefined> = {
it,
ja,
ko,
nl,
['pt-BR']: ptBR,
ru,
th,
+2
View File
@@ -145,6 +145,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.ja
case 'ko':
return AppLanguage.ko
case 'nl':
return AppLanguage.nl
case 'pt-BR':
return AppLanguage.pt_BR
case 'ru':
+9
View File
@@ -25,6 +25,7 @@ import {messages as messagesId} from '#/locale/locales/id/messages'
import {messages as messagesIt} from '#/locale/locales/it/messages'
import {messages as messagesJa} from '#/locale/locales/ja/messages'
import {messages as messagesKo} from '#/locale/locales/ko/messages'
import {messages as messagesNl} from '#/locale/locales/nl/messages'
import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages'
import {messages as messagesRu} from '#/locale/locales/ru/messages'
import {messages as messagesTh} from '#/locale/locales/th/messages'
@@ -144,6 +145,14 @@ export async function dynamicActivate(locale: AppLanguage) {
])
break
}
case AppLanguage.nl: {
i18n.loadAndActivate({locale, messages: messagesNl})
await Promise.all([
import('@formatjs/intl-pluralrules/locale-data/nl'),
import('@formatjs/intl-numberformat/locale-data/nl'),
])
break
}
case AppLanguage.pt_BR: {
i18n.loadAndActivate({locale, messages: messagesPt_BR})
await Promise.all([
+4
View File
@@ -64,6 +64,10 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/ko/messages`)
break
}
case AppLanguage.nl: {
mod = await import(`./locales/nl/messages`)
break
}
case AppLanguage.pt_BR: {
mod = await import(`./locales/pt-BR/messages`)
break
+2
View File
@@ -19,6 +19,7 @@ export enum AppLanguage {
it = 'it',
ja = 'ja',
ko = 'ko',
nl = 'nl',
pt_BR = 'pt-BR',
ru = 'ru',
th = 'th',
@@ -49,6 +50,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.it, name: 'Italiano Italian'},
{code2: AppLanguage.ja, name: '日本語 Japanese'},
{code2: AppLanguage.ko, name: '한국어 Korean'},
{code2: AppLanguage.nl, name: 'Nederlands Dutch'},
{code2: AppLanguage.pt_BR, name: 'Português (BR) Portuguese (BR)'},
{code2: AppLanguage.ru, name: 'Русский Russian'},
{code2: AppLanguage.th, name: 'ภาษาไทย Thai'},