Add italian to app languages

zio/stable
Paul Frazee 2024-02-13 10:01:59 -08:00
parent b8139db60f
commit aaba84f214
5 changed files with 15 additions and 0 deletions

View File

@ -13,6 +13,7 @@ module.exports = {
'uk', 'uk',
'ca', 'ca',
'zh-CN', 'zh-CN',
'it',
], ],
catalogs: [ catalogs: [
{ {

View File

@ -140,6 +140,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.ca return AppLanguage.ca
case 'zh-CN': case 'zh-CN':
return AppLanguage.zh_CN return AppLanguage.zh_CN
case 'it':
return AppLanguage.it
default: default:
continue continue
} }

View File

@ -14,6 +14,7 @@ import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages'
import {messages as messagesUk} from '#/locale/locales/uk/messages' import {messages as messagesUk} from '#/locale/locales/uk/messages'
import {messages as messagesCa} from '#/locale/locales/ca/messages' import {messages as messagesCa} from '#/locale/locales/ca/messages'
import {messages as messagesZh_CN} from '#/locale/locales/zh-CN/messages' import {messages as messagesZh_CN} from '#/locale/locales/zh-CN/messages'
import {messages as messagesIt} from '#/locale/locales/it/messages'
import {sanitizeAppLanguageSetting} from '#/locale/helpers' import {sanitizeAppLanguageSetting} from '#/locale/helpers'
import {AppLanguage} from '#/locale/languages' import {AppLanguage} from '#/locale/languages'
@ -65,6 +66,11 @@ export async function dynamicActivate(locale: AppLanguage) {
} }
case AppLanguage.zh_CN: { case AppLanguage.zh_CN: {
i18n.loadAndActivate({locale, messages: messagesZh_CN}) i18n.loadAndActivate({locale, messages: messagesZh_CN})
break
}
case AppLanguage.it: {
i18n.loadAndActivate({locale, messages: messagesIt})
break
} }
default: { default: {
i18n.loadAndActivate({locale, messages: messagesEn}) i18n.loadAndActivate({locale, messages: messagesEn})

View File

@ -56,6 +56,10 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/zh-CN/messages`) mod = await import(`./locales/zh-CN/messages`)
break break
} }
case AppLanguage.it: {
mod = await import(`./locales/it/messages`)
break
}
default: { default: {
mod = await import(`./locales/en/messages`) mod = await import(`./locales/en/messages`)
break break

View File

@ -17,6 +17,7 @@ export enum AppLanguage {
uk = 'uk', uk = 'uk',
ca = 'ca', ca = 'ca',
zh_CN = 'zh-CN', zh_CN = 'zh-CN',
it = 'it',
} }
interface AppLanguageConfig { interface AppLanguageConfig {
@ -37,6 +38,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.uk, name: 'Українська Ukrainian'}, {code2: AppLanguage.uk, name: 'Українська Ukrainian'},
{code2: AppLanguage.ca, name: 'Català Catalan'}, {code2: AppLanguage.ca, name: 'Català Catalan'},
{code2: AppLanguage.zh_CN, name: '简体中文(中国) Chinese (Simplified)'}, {code2: AppLanguage.zh_CN, name: '简体中文(中国) Chinese (Simplified)'},
{code2: AppLanguage.it, name: 'Italiano - Italian'},
] ]
export const LANGUAGES: Language[] = [ export const LANGUAGES: Language[] = [