Skip to content

Commit 3bee621

Browse files
authored
Enable Spanish Localization (#2405)
* add `es` to `lingui.config.js` * update messages.po * enable spanish localization
1 parent 4baef7a commit 3bee621

File tree

6 files changed

+93
-94
lines changed

6 files changed

+93
-94
lines changed

lingui.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('@lingui/conf').LinguiConfig} */
22
module.exports = {
3-
locales: ['en', 'hi', 'ja', 'fr', 'de', 'es', 'ko'],
3+
locales: ['en', 'hi', 'ja', 'fr', 'de', 'es', 'ko', 'es'],
44
catalogs: [
55
{
66
path: '<rootDir>/src/locale/locales/{locale}/messages',

src/locale/helpers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
114114
// case 'de':
115115
// return AppLanguage.de
116116
// DISABLED until this translation is more thoroughly reviewed -prf
117-
// case 'es':
118-
// return AppLanguage.es
117+
case 'es':
118+
return AppLanguage.es
119119
case 'fr':
120120
return AppLanguage.fr
121121
case 'hi':

src/locale/i18n.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import {useLanguagePrefs} from '#/state/preferences'
55
import {messages as messagesEn} from '#/locale/locales/en/messages'
66
// DISABLED until this translation is fixed -prf
77
// import {messages as messagesDe} from '#/locale/locales/de/messages'
8-
// DISABLED until this translation is more thoroughly reviewed -prf
9-
// import {messages as messagesEs} from '#/locale/locales/es/messages'
8+
import {messages as messagesEs} from '#/locale/locales/es/messages'
109
import {messages as messagesFr} from '#/locale/locales/fr/messages'
1110
import {messages as messagesHi} from '#/locale/locales/hi/messages'
1211
import {messages as messagesJa} from '#/locale/locales/ja/messages'
@@ -25,11 +24,10 @@ export async function dynamicActivate(locale: AppLanguage) {
2524
// i18n.loadAndActivate({locale, messages: messagesDe})
2625
// break
2726
// }
28-
// DISABLED until this translation is more thoroughly reviewed -prf
29-
// case AppLanguage.es: {
30-
// i18n.loadAndActivate({locale, messages: messagesEs})
31-
// break
32-
// }
27+
case AppLanguage.es: {
28+
i18n.loadAndActivate({locale, messages: messagesEs})
29+
break
30+
}
3331
case AppLanguage.fr: {
3432
i18n.loadAndActivate({locale, messages: messagesFr})
3533
break

src/locale/i18n.web.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ export async function dynamicActivate(locale: AppLanguage) {
1717
// mod = await import(`./locales/de/messages`)
1818
// break
1919
// }
20-
// DISABLED until this translation is more thoroughly reviewed -prf
21-
// case AppLanguage.es: {
22-
// mod = await import(`./locales/es/messages`)
23-
// break
24-
// }
20+
case AppLanguage.es: {
21+
mod = await import(`./locales/es/messages`)
22+
break
23+
}
2524
case AppLanguage.fr: {
2625
mod = await import(`./locales/fr/messages`)
2726
break

src/locale/languages.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ export enum AppLanguage {
88
en = 'en',
99
// DISABLED until this translation is fixed -prf
1010
// de = 'de',
11-
// DISABLED until this translation is more thoroughly reviewed -prf
12-
// es = 'es',
11+
es = 'es',
1312
fr = 'fr',
1413
hi = 'hi',
1514
ja = 'ja',
@@ -25,8 +24,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
2524
{code2: AppLanguage.en, name: 'English'},
2625
// DISABLED until this translation is fixed -prf
2726
// {code2: AppLanguage.de, name: 'Deutsch'},
28-
// DISABLED until this translation is more thoroughly reviewed -prf
29-
// {code2: AppLanguage.es, name: 'Español'},
27+
{code2: AppLanguage.es, name: 'Español'},
3028
{code2: AppLanguage.fr, name: 'Français'},
3129
{code2: AppLanguage.hi, name: 'हिंदी'},
3230
{code2: AppLanguage.ja, name: '日本語'},

0 commit comments

Comments
 (0)