parent
d4bb64c1e6
commit
ffd08570a5
|
@ -1,6 +1,6 @@
|
|||
/** @type {import('@lingui/conf').LinguiConfig} */
|
||||
module.exports = {
|
||||
locales: ['en', 'hi', 'ja', 'fr', 'de', 'es'],
|
||||
locales: ['en', 'hi', 'ja', 'fr', 'de', 'es', 'ko'],
|
||||
catalogs: [
|
||||
{
|
||||
path: '<rootDir>/src/locale/locales/{locale}/messages',
|
||||
|
|
|
@ -110,18 +110,20 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
|
|||
switch (lang) {
|
||||
case 'en':
|
||||
return AppLanguage.en
|
||||
case 'hi':
|
||||
return AppLanguage.hi
|
||||
case 'ja':
|
||||
return AppLanguage.ja
|
||||
case 'fr':
|
||||
return AppLanguage.fr
|
||||
// DISABLED until this translation is fixed -prf
|
||||
// case 'de':
|
||||
// return AppLanguage.de
|
||||
// DISABLED until this translation is more thoroughly reviewed -prf
|
||||
// case 'es':
|
||||
// return AppLanguage.es
|
||||
case 'fr':
|
||||
return AppLanguage.fr
|
||||
case 'hi':
|
||||
return AppLanguage.hi
|
||||
case 'ja':
|
||||
return AppLanguage.ja
|
||||
case 'ko':
|
||||
return AppLanguage.ko
|
||||
default:
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -3,13 +3,14 @@ import {i18n} from '@lingui/core'
|
|||
|
||||
import {useLanguagePrefs} from '#/state/preferences'
|
||||
import {messages as messagesEn} from '#/locale/locales/en/messages'
|
||||
import {messages as messagesHi} from '#/locale/locales/hi/messages'
|
||||
import {messages as messagesJa} from '#/locale/locales/ja/messages'
|
||||
import {messages as messagesFr} from '#/locale/locales/fr/messages'
|
||||
// DISABLED until this translation is fixed -prf
|
||||
// import {messages as messagesDe} from '#/locale/locales/de/messages'
|
||||
// DISABLED until this translation is more thoroughly reviewed -prf
|
||||
// import {messages as messagesEs} from '#/locale/locales/es/messages'
|
||||
import {messages as messagesFr} from '#/locale/locales/fr/messages'
|
||||
import {messages as messagesHi} from '#/locale/locales/hi/messages'
|
||||
import {messages as messagesJa} from '#/locale/locales/ja/messages'
|
||||
import {messages as messagesKo} from '#/locale/locales/ko/messages'
|
||||
|
||||
import {sanitizeAppLanguageSetting} from '#/locale/helpers'
|
||||
import {AppLanguage} from '#/locale/languages'
|
||||
|
@ -19,18 +20,6 @@ import {AppLanguage} from '#/locale/languages'
|
|||
*/
|
||||
export async function dynamicActivate(locale: AppLanguage) {
|
||||
switch (locale) {
|
||||
case AppLanguage.hi: {
|
||||
i18n.loadAndActivate({locale, messages: messagesHi})
|
||||
break
|
||||
}
|
||||
case AppLanguage.ja: {
|
||||
i18n.loadAndActivate({locale, messages: messagesJa})
|
||||
break
|
||||
}
|
||||
case AppLanguage.fr: {
|
||||
i18n.loadAndActivate({locale, messages: messagesFr})
|
||||
break
|
||||
}
|
||||
// DISABLED until this translation is fixed -prf
|
||||
// case AppLanguage.de: {
|
||||
// i18n.loadAndActivate({locale, messages: messagesDe})
|
||||
|
@ -41,6 +30,22 @@ export async function dynamicActivate(locale: AppLanguage) {
|
|||
// i18n.loadAndActivate({locale, messages: messagesEs})
|
||||
// break
|
||||
// }
|
||||
case AppLanguage.fr: {
|
||||
i18n.loadAndActivate({locale, messages: messagesFr})
|
||||
break
|
||||
}
|
||||
case AppLanguage.hi: {
|
||||
i18n.loadAndActivate({locale, messages: messagesHi})
|
||||
break
|
||||
}
|
||||
case AppLanguage.ja: {
|
||||
i18n.loadAndActivate({locale, messages: messagesJa})
|
||||
break
|
||||
}
|
||||
case AppLanguage.ko: {
|
||||
i18n.loadAndActivate({locale, messages: messagesKo})
|
||||
break
|
||||
}
|
||||
default: {
|
||||
i18n.loadAndActivate({locale, messages: messagesEn})
|
||||
break
|
||||
|
|
|
@ -12,18 +12,6 @@ export async function dynamicActivate(locale: AppLanguage) {
|
|||
let mod: any
|
||||
|
||||
switch (locale) {
|
||||
case AppLanguage.hi: {
|
||||
mod = await import(`./locales/hi/messages`)
|
||||
break
|
||||
}
|
||||
case AppLanguage.ja: {
|
||||
mod = await import(`./locales/ja/messages`)
|
||||
break
|
||||
}
|
||||
case AppLanguage.fr: {
|
||||
mod = await import(`./locales/fr/messages`)
|
||||
break
|
||||
}
|
||||
// DISABLED until this translation is fixed -prf
|
||||
// case AppLanguage.de: {
|
||||
// mod = await import(`./locales/de/messages`)
|
||||
|
@ -34,6 +22,22 @@ export async function dynamicActivate(locale: AppLanguage) {
|
|||
// mod = await import(`./locales/es/messages`)
|
||||
// break
|
||||
// }
|
||||
case AppLanguage.fr: {
|
||||
mod = await import(`./locales/fr/messages`)
|
||||
break
|
||||
}
|
||||
case AppLanguage.hi: {
|
||||
mod = await import(`./locales/hi/messages`)
|
||||
break
|
||||
}
|
||||
case AppLanguage.ja: {
|
||||
mod = await import(`./locales/ja/messages`)
|
||||
break
|
||||
}
|
||||
case AppLanguage.ko: {
|
||||
mod = await import(`./locales/ko/messages`)
|
||||
break
|
||||
}
|
||||
default: {
|
||||
mod = await import(`./locales/en/messages`)
|
||||
break
|
||||
|
|
|
@ -6,13 +6,14 @@ interface Language {
|
|||
|
||||
export enum AppLanguage {
|
||||
en = 'en',
|
||||
hi = 'hi',
|
||||
ja = 'ja',
|
||||
fr = 'fr',
|
||||
// DISABLED until this translation is fixed -prf
|
||||
// de = 'de',
|
||||
// DISABLED until this translation is more thoroughly reviewed -prf
|
||||
// es = 'es',
|
||||
fr = 'fr',
|
||||
hi = 'hi',
|
||||
ja = 'ja',
|
||||
ko = 'ko',
|
||||
}
|
||||
|
||||
interface AppLanguageConfig {
|
||||
|
@ -22,13 +23,14 @@ interface AppLanguageConfig {
|
|||
|
||||
export const APP_LANGUAGES: AppLanguageConfig[] = [
|
||||
{code2: AppLanguage.en, name: 'English'},
|
||||
{code2: AppLanguage.hi, name: 'हिंदी'},
|
||||
{code2: AppLanguage.ja, name: '日本語'},
|
||||
{code2: AppLanguage.fr, name: 'Français'},
|
||||
// DISABLED until this translation is fixed -prf
|
||||
// {code2: AppLanguage.de, name: 'Deutsch'},
|
||||
// DISABLED until this translation is more thoroughly reviewed -prf
|
||||
// {code2: AppLanguage.es, name: 'Español'},
|
||||
{code2: AppLanguage.fr, name: 'Français'},
|
||||
{code2: AppLanguage.hi, name: 'हिंदी'},
|
||||
{code2: AppLanguage.ja, name: '日本語'},
|
||||
{code2: AppLanguage.ko, name: '한국어'},
|
||||
]
|
||||
|
||||
export const LANGUAGES: Language[] = [
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue