feat(lang): add Arabic and Lithuanian display languages (#2916)

pull/2919/head
TheCatLady 2 years ago committed by GitHub
parent 1fcfe93b58
commit 3db3044210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,6 +2,7 @@ import type { ReactNode } from 'react';
import React from 'react'; import React from 'react';
export type AvailableLocale = export type AvailableLocale =
| 'ar'
| 'ca' | 'ca'
| 'cs' | 'cs'
| 'da' | 'da'
@ -9,10 +10,11 @@ export type AvailableLocale =
| 'en' | 'en'
| 'el' | 'el'
| 'es' | 'es'
| 'it'
| 'ja'
| 'fr' | 'fr'
| 'hu' | 'hu'
| 'it'
| 'ja'
| 'lt'
| 'nb-NO' | 'nb-NO'
| 'nl' | 'nl'
| 'pl' | 'pl'
@ -63,6 +65,10 @@ export const availableLanguages: AvailableLanguageObject = {
code: 'it', code: 'it',
display: 'Italiano', display: 'Italiano',
}, },
lt: {
code: 'lt',
display: 'Lietuvių',
},
hu: { hu: {
code: 'hu', code: 'hu',
display: 'Magyar', display: 'Magyar',
@ -107,6 +113,10 @@ export const availableLanguages: AvailableLanguageObject = {
code: 'sr', code: 'sr',
display: 'српски језик', display: 'српски језик',
}, },
ar: {
code: 'ar',
display: 'العربية',
},
ja: { ja: {
code: 'ja', code: 'ja',
display: '日本語', display: '日本語',

@ -25,6 +25,8 @@ import '../styles/globals.css';
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const loadLocaleData = (locale: AvailableLocale): Promise<any> => { const loadLocaleData = (locale: AvailableLocale): Promise<any> => {
switch (locale) { switch (locale) {
case 'ar':
return import('../i18n/locale/ar.json');
case 'ca': case 'ca':
return import('../i18n/locale/ca.json'); return import('../i18n/locale/ca.json');
case 'cs': case 'cs':
@ -39,12 +41,14 @@ const loadLocaleData = (locale: AvailableLocale): Promise<any> => {
return import('../i18n/locale/es.json'); return import('../i18n/locale/es.json');
case 'fr': case 'fr':
return import('../i18n/locale/fr.json'); return import('../i18n/locale/fr.json');
case 'hu':
return import('../i18n/locale/hu.json');
case 'it': case 'it':
return import('../i18n/locale/it.json'); return import('../i18n/locale/it.json');
case 'ja': case 'ja':
return import('../i18n/locale/ja.json'); return import('../i18n/locale/ja.json');
case 'hu': case 'lt':
return import('../i18n/locale/hu.json'); return import('../i18n/locale/lt.json');
case 'nb-NO': case 'nb-NO':
return import('../i18n/locale/nb_NO.json'); return import('../i18n/locale/nb_NO.json');
case 'nl': case 'nl':

Loading…
Cancel
Save