Add Spanish localization (#2267)
* add french localization * get dynamic import to work * fix broken strings * fix bug * fix tests * build files again * add german locale * Add german translated strings * update file details * fix plural case errors * make german translations work * add 'es' as a locale option * enable spanish translations * fix spelling mistakezio/stable
parent
a5c151c041
commit
c1d7d9a41b
|
@ -1,6 +1,6 @@
|
||||||
/** @type {import('@lingui/conf').LinguiConfig} */
|
/** @type {import('@lingui/conf').LinguiConfig} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
locales: ['en', 'hi', 'ja', 'fr'],
|
locales: ['en', 'hi', 'ja', 'fr', 'de', 'es'],
|
||||||
catalogs: [
|
catalogs: [
|
||||||
{
|
{
|
||||||
path: '<rootDir>/src/locale/locales/{locale}/messages',
|
path: '<rootDir>/src/locale/locales/{locale}/messages',
|
||||||
|
|
|
@ -116,6 +116,10 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
|
||||||
return AppLanguage.ja
|
return AppLanguage.ja
|
||||||
case 'fr':
|
case 'fr':
|
||||||
return AppLanguage.fr
|
return AppLanguage.fr
|
||||||
|
case 'de':
|
||||||
|
return AppLanguage.de
|
||||||
|
case 'es':
|
||||||
|
return AppLanguage.es
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,9 @@ import {messages as messagesEn} from '#/locale/locales/en/messages'
|
||||||
import {messages as messagesHi} from '#/locale/locales/hi/messages'
|
import {messages as messagesHi} from '#/locale/locales/hi/messages'
|
||||||
import {messages as messagesJa} from '#/locale/locales/ja/messages'
|
import {messages as messagesJa} from '#/locale/locales/ja/messages'
|
||||||
import {messages as messagesFr} from '#/locale/locales/fr/messages'
|
import {messages as messagesFr} from '#/locale/locales/fr/messages'
|
||||||
|
import {messages as messagesDe} from '#/locale/locales/de/messages'
|
||||||
|
import {messages as messagesEs} from '#/locale/locales/de/messages'
|
||||||
|
|
||||||
import {sanitizeAppLanguageSetting} from '#/locale/helpers'
|
import {sanitizeAppLanguageSetting} from '#/locale/helpers'
|
||||||
import {AppLanguage} from '#/locale/languages'
|
import {AppLanguage} from '#/locale/languages'
|
||||||
|
|
||||||
|
@ -26,6 +29,14 @@ export async function dynamicActivate(locale: AppLanguage) {
|
||||||
i18n.loadAndActivate({locale, messages: messagesFr})
|
i18n.loadAndActivate({locale, messages: messagesFr})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
case AppLanguage.de: {
|
||||||
|
i18n.loadAndActivate({locale, messages: messagesDe})
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case AppLanguage.es: {
|
||||||
|
i18n.loadAndActivate({locale, messages: messagesEs})
|
||||||
|
break
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
i18n.loadAndActivate({locale, messages: messagesEn})
|
i18n.loadAndActivate({locale, messages: messagesEn})
|
||||||
break
|
break
|
||||||
|
|
|
@ -24,6 +24,14 @@ export async function dynamicActivate(locale: AppLanguage) {
|
||||||
mod = await import(`./locales/fr/messages`)
|
mod = await import(`./locales/fr/messages`)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
case AppLanguage.de: {
|
||||||
|
mod = await import(`./locales/de/messages`)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case AppLanguage.es: {
|
||||||
|
mod = await import(`./locales/es/messages`)
|
||||||
|
break
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
mod = await import(`./locales/en/messages`)
|
mod = await import(`./locales/en/messages`)
|
||||||
break
|
break
|
||||||
|
|
|
@ -9,6 +9,8 @@ export enum AppLanguage {
|
||||||
hi = 'hi',
|
hi = 'hi',
|
||||||
ja = 'ja',
|
ja = 'ja',
|
||||||
fr = 'fr',
|
fr = 'fr',
|
||||||
|
de = 'de',
|
||||||
|
es = 'es',
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AppLanguageConfig {
|
interface AppLanguageConfig {
|
||||||
|
@ -21,6 +23,8 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
|
||||||
{code2: AppLanguage.hi, name: 'हिंदी'},
|
{code2: AppLanguage.hi, name: 'हिंदी'},
|
||||||
{code2: AppLanguage.ja, name: '日本語'},
|
{code2: AppLanguage.ja, name: '日本語'},
|
||||||
{code2: AppLanguage.fr, name: 'Français'},
|
{code2: AppLanguage.fr, name: 'Français'},
|
||||||
|
{code2: AppLanguage.de, name: 'Deutsch'},
|
||||||
|
{code2: AppLanguage.es, name: 'Español'},
|
||||||
]
|
]
|
||||||
|
|
||||||
export const LANGUAGES: Language[] = [
|
export const LANGUAGES: Language[] = [
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue