Add Greek Language ('el') Support and Internationalization (#6677)
* Add Greek language support to the application * Add support for Greek language in date handling and tests * Update Greek locale file with translator and team information * Add support for Greek language in date handling and tests * Add support for Greek language in app configuration, and updated translation from the reviewers' comments * Update src/locale/i18n.ts Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * Update src/locale/i18n.ts Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
30d110dbcd
commit
2300410b4d
@@ -76,6 +76,7 @@ module.exports = function (config) {
|
||||
'ast',
|
||||
'ca',
|
||||
'de',
|
||||
'el',
|
||||
'es',
|
||||
'fi',
|
||||
'fr',
|
||||
|
||||
@@ -6,6 +6,7 @@ module.exports = {
|
||||
'ast',
|
||||
'ca',
|
||||
'de',
|
||||
'el',
|
||||
'en-GB',
|
||||
'es',
|
||||
'fi',
|
||||
|
||||
@@ -12,6 +12,7 @@ import {formatDistance, Locale} from 'date-fns'
|
||||
import {
|
||||
ca,
|
||||
de,
|
||||
el,
|
||||
enGB,
|
||||
es,
|
||||
fi,
|
||||
@@ -50,6 +51,7 @@ const locales: Record<AppLanguage, Locale | undefined> = {
|
||||
ast: undefined,
|
||||
ca,
|
||||
de,
|
||||
el,
|
||||
['en-GB']: enGB,
|
||||
es,
|
||||
fi,
|
||||
|
||||
@@ -5,6 +5,7 @@ import {AppLanguage} from '#/locale/languages'
|
||||
|
||||
test('sanitizeAppLanguageSetting', () => {
|
||||
expect(sanitizeAppLanguageSetting('en')).toBe(AppLanguage.en)
|
||||
expect(sanitizeAppLanguageSetting('el')).toBe(AppLanguage.el)
|
||||
expect(sanitizeAppLanguageSetting('pt-BR')).toBe(AppLanguage.pt_BR)
|
||||
expect(sanitizeAppLanguageSetting('hi')).toBe(AppLanguage.hi)
|
||||
expect(sanitizeAppLanguageSetting('id')).toBe(AppLanguage.id)
|
||||
|
||||
@@ -127,6 +127,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
|
||||
return AppLanguage.ca
|
||||
case 'de':
|
||||
return AppLanguage.de
|
||||
case 'el':
|
||||
return AppLanguage.el
|
||||
case 'en-GB':
|
||||
return AppLanguage.en_GB
|
||||
case 'es':
|
||||
|
||||
@@ -15,6 +15,7 @@ import {messages as messagesAn} from '#/locale/locales/an/messages'
|
||||
import {messages as messagesAst} from '#/locale/locales/ast/messages'
|
||||
import {messages as messagesCa} from '#/locale/locales/ca/messages'
|
||||
import {messages as messagesDe} from '#/locale/locales/de/messages'
|
||||
import {messages as messagesEl} from '#/locale/locales/el/messages'
|
||||
import {messages as messagesEn} from '#/locale/locales/en/messages'
|
||||
import {messages as messagesEn_GB} from '#/locale/locales/en-GB/messages'
|
||||
import {messages as messagesEs} from '#/locale/locales/es/messages'
|
||||
@@ -81,6 +82,14 @@ export async function dynamicActivate(locale: AppLanguage) {
|
||||
])
|
||||
break
|
||||
}
|
||||
case AppLanguage.el: {
|
||||
i18n.loadAndActivate({locale, messages: messagesEl})
|
||||
await Promise.all([
|
||||
import('@formatjs/intl-pluralrules/locale-data/el'),
|
||||
import('@formatjs/intl-numberformat/locale-data/el'),
|
||||
])
|
||||
break
|
||||
}
|
||||
case AppLanguage.en_GB: {
|
||||
i18n.loadAndActivate({locale, messages: messagesEn_GB})
|
||||
await Promise.all([
|
||||
|
||||
@@ -28,6 +28,10 @@ export async function dynamicActivate(locale: AppLanguage) {
|
||||
mod = await import(`./locales/de/messages`)
|
||||
break
|
||||
}
|
||||
case AppLanguage.el: {
|
||||
mod = await import(`./locales/el/messages`)
|
||||
break
|
||||
}
|
||||
case AppLanguage.en_GB: {
|
||||
mod = await import(`./locales/en-GB/messages`)
|
||||
break
|
||||
|
||||
@@ -10,6 +10,7 @@ export enum AppLanguage {
|
||||
ast = 'ast',
|
||||
ca = 'ca',
|
||||
de = 'de',
|
||||
el = 'el',
|
||||
en_GB = 'en-GB',
|
||||
es = 'es',
|
||||
fi = 'fi',
|
||||
@@ -49,6 +50,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
|
||||
{code2: AppLanguage.ast, name: 'Asturianu – Asturian'},
|
||||
{code2: AppLanguage.ca, name: 'Català – Catalan'},
|
||||
{code2: AppLanguage.de, name: 'Deutsch – German'},
|
||||
{code2: AppLanguage.el, name: 'Ελληνικά – Greek'},
|
||||
{code2: AppLanguage.en_GB, name: 'English (UK)'},
|
||||
{code2: AppLanguage.es, name: 'Español – Spanish'},
|
||||
{code2: AppLanguage.fi, name: 'Suomi – Finnish'},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user