From 2afb65608f978dbe45979881fc6498a0abe8e78a Mon Sep 17 00:00:00 2001 From: Jordan Jones Date: Tue, 2 Apr 2024 12:31:26 -0500 Subject: [PATCH 1/5] feat(lang): add config for finnish, bulgarian and ukranian --- src/context/LanguageContext.tsx | 15 +++++++++++++++ src/pages/_app.tsx | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/src/context/LanguageContext.tsx b/src/context/LanguageContext.tsx index e6164af7a5..80fad10bdc 100644 --- a/src/context/LanguageContext.tsx +++ b/src/context/LanguageContext.tsx @@ -2,6 +2,7 @@ import React from 'react'; export type AvailableLocale = | 'ar' + | 'bg' | 'ca' | 'cs' | 'da' @@ -9,6 +10,7 @@ export type AvailableLocale = | 'en' | 'el' | 'es' + | 'fi' | 'fr' | 'hr' | 'hu' @@ -25,6 +27,7 @@ export type AvailableLocale = | 'sq' | 'sr' | 'sv' + | 'uk' | 'zh-CN' | 'zh-TW'; @@ -34,6 +37,10 @@ type AvailableLanguageObject = Record< >; export const availableLanguages: AvailableLanguageObject = { + bg: { + code: 'bg', + display: 'Bulgarian', + }, ca: { code: 'ca', display: 'Català', @@ -58,6 +65,10 @@ export const availableLanguages: AvailableLanguageObject = { code: 'es', display: 'Español', }, + fi: { + code: 'fi', + display: 'Finnish', + }, fr: { code: 'fr', display: 'Français', @@ -130,6 +141,10 @@ export const availableLanguages: AvailableLanguageObject = { code: 'ko', display: '한국어', }, + uk: { + code: 'uk', + display: 'Ukrainian', + }, 'zh-TW': { code: 'zh-TW', display: '繁體中文', diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index ceb5734ecb..59c98e191a 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -28,6 +28,8 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { switch (locale) { case 'ar': return import('../i18n/locale/ar.json'); + case 'bg': + return import('../i18n/locale/bg.json'); case 'ca': return import('../i18n/locale/ca.json'); case 'cs': @@ -40,6 +42,8 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/el.json'); case 'es': return import('../i18n/locale/es.json'); + case 'fi': + return import('../i18n/locale/fi.json'); case 'fr': return import('../i18n/locale/fr.json'); case 'hr': @@ -72,6 +76,8 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/sr.json'); case 'sv': return import('../i18n/locale/sv.json'); + case 'uk': + return import('../i18n/locale/uk.json'); case 'zh-CN': return import('../i18n/locale/zh_Hans.json'); case 'zh-TW': From 6a4cd84416ab17c8cf8fdc83469bd88b5de4ae42 Mon Sep 17 00:00:00 2001 From: Jordan Jones Date: Tue, 2 Apr 2024 13:27:46 -0500 Subject: [PATCH 2/5] feat(lang): add lang config for maori turkish and indonesian --- src/context/LanguageContext.tsx | 15 +++++++++++++++ src/i18n/locale/id.json | 1 + src/i18n/locale/mi.json | 1 + src/i18n/locale/tr.json | 1 + src/pages/_app.tsx | 6 ++++++ 5 files changed, 24 insertions(+) create mode 100644 src/i18n/locale/id.json create mode 100644 src/i18n/locale/mi.json create mode 100644 src/i18n/locale/tr.json diff --git a/src/context/LanguageContext.tsx b/src/context/LanguageContext.tsx index 80fad10bdc..9c22186ddc 100644 --- a/src/context/LanguageContext.tsx +++ b/src/context/LanguageContext.tsx @@ -15,9 +15,11 @@ export type AvailableLocale = | 'hr' | 'hu' | 'it' + | 'id' | 'ja' | 'ko' | 'lt' + | 'mi' | 'nb-NO' | 'nl' | 'pl' @@ -27,6 +29,7 @@ export type AvailableLocale = | 'sq' | 'sr' | 'sv' + | 'tr' | 'uk' | 'zh-CN' | 'zh-TW'; @@ -89,6 +92,10 @@ export const availableLanguages: AvailableLanguageObject = { code: 'hu', display: 'Magyar', }, + mi: { + code: 'mi', + display: 'Maori', + }, nl: { code: 'nl', display: 'Nederlands', @@ -141,6 +148,14 @@ export const availableLanguages: AvailableLanguageObject = { code: 'ko', display: '한국어', }, + id: { + code: 'id', + display: 'Indonesian', + }, + tr: { + code: 'tr', + display: 'Turkish', + }, uk: { code: 'uk', display: 'Ukrainian', diff --git a/src/i18n/locale/id.json b/src/i18n/locale/id.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/src/i18n/locale/id.json @@ -0,0 +1 @@ +{} diff --git a/src/i18n/locale/mi.json b/src/i18n/locale/mi.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/src/i18n/locale/mi.json @@ -0,0 +1 @@ +{} diff --git a/src/i18n/locale/tr.json b/src/i18n/locale/tr.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/src/i18n/locale/tr.json @@ -0,0 +1 @@ +{} diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 59c98e191a..6bb651bda7 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -52,12 +52,16 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/hu.json'); case 'it': return import('../i18n/locale/it.json'); + case 'id': + return import('../i18n/locale/id.json'); case 'ja': return import('../i18n/locale/ja.json'); case 'ko': return import('../i18n/locale/ko.json'); case 'lt': return import('../i18n/locale/lt.json'); + case 'mi': + return import('../i18n/locale/mi.json'); case 'nb-NO': return import('../i18n/locale/nb_NO.json'); case 'nl': @@ -78,6 +82,8 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/sv.json'); case 'uk': return import('../i18n/locale/uk.json'); + case 'tr': + return import('../i18n/locale/tr.json'); case 'zh-CN': return import('../i18n/locale/zh_Hans.json'); case 'zh-TW': From 1e33fb755fe4d453bae28634107f3549df72dd8c Mon Sep 17 00:00:00 2001 From: Jordan Jones Date: Tue, 2 Apr 2024 13:38:06 -0500 Subject: [PATCH 3/5] feat: add Slovak and update language names --- src/context/LanguageContext.tsx | 13 +++++++++---- src/i18n/locale/sk.json | 1 + src/pages/_app.tsx | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/i18n/locale/sk.json diff --git a/src/context/LanguageContext.tsx b/src/context/LanguageContext.tsx index 9c22186ddc..e719ee2ca6 100644 --- a/src/context/LanguageContext.tsx +++ b/src/context/LanguageContext.tsx @@ -26,6 +26,7 @@ export type AvailableLocale = | 'pt-BR' | 'pt-PT' | 'ru' + | 'sk' | 'sq' | 'sr' | 'sv' @@ -94,7 +95,7 @@ export const availableLanguages: AvailableLanguageObject = { }, mi: { code: 'mi', - display: 'Maori', + display: 'Māori', }, nl: { code: 'nl', @@ -132,6 +133,10 @@ export const availableLanguages: AvailableLanguageObject = { code: 'ru', display: 'pусский', }, + Slovak: { + code: 'sk', + display: 'Slovák', + }, sr: { code: 'sr', display: 'српски језик', @@ -150,15 +155,15 @@ export const availableLanguages: AvailableLanguageObject = { }, id: { code: 'id', - display: 'Indonesian', + display: 'Bahasa Indonesia', }, tr: { code: 'tr', - display: 'Turkish', + display: 'Türkçe', }, uk: { code: 'uk', - display: 'Ukrainian', + display: 'українська мова', }, 'zh-TW': { code: 'zh-TW', diff --git a/src/i18n/locale/sk.json b/src/i18n/locale/sk.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/src/i18n/locale/sk.json @@ -0,0 +1 @@ +{} diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 6bb651bda7..c7fc29a93a 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -74,6 +74,8 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/pt_PT.json'); case 'ru': return import('../i18n/locale/ru.json'); + case 'sk': + return import('../i18n/locale/sk.json'); case 'sq': return import('../i18n/locale/sq.json'); case 'sr': From 3c130fdfa2515db434778fe053a9ffd0963135a4 Mon Sep 17 00:00:00 2001 From: Jordan Jones Date: Wed, 17 Apr 2024 21:03:35 -0500 Subject: [PATCH 4/5] fix: remove unused langs --- src/context/LanguageContext.tsx | 20 -------------------- src/i18n/locale/id.json | 1 - src/i18n/locale/mi.json | 1 - src/i18n/locale/sk.json | 1 - src/i18n/locale/tr.json | 1 - src/pages/_app.tsx | 12 ------------ 6 files changed, 36 deletions(-) delete mode 100644 src/i18n/locale/id.json delete mode 100644 src/i18n/locale/mi.json delete mode 100644 src/i18n/locale/sk.json delete mode 100644 src/i18n/locale/tr.json diff --git a/src/context/LanguageContext.tsx b/src/context/LanguageContext.tsx index e719ee2ca6..987da28e91 100644 --- a/src/context/LanguageContext.tsx +++ b/src/context/LanguageContext.tsx @@ -15,22 +15,18 @@ export type AvailableLocale = | 'hr' | 'hu' | 'it' - | 'id' | 'ja' | 'ko' | 'lt' - | 'mi' | 'nb-NO' | 'nl' | 'pl' | 'pt-BR' | 'pt-PT' | 'ru' - | 'sk' | 'sq' | 'sr' | 'sv' - | 'tr' | 'uk' | 'zh-CN' | 'zh-TW'; @@ -93,10 +89,6 @@ export const availableLanguages: AvailableLanguageObject = { code: 'hu', display: 'Magyar', }, - mi: { - code: 'mi', - display: 'Māori', - }, nl: { code: 'nl', display: 'Nederlands', @@ -133,10 +125,6 @@ export const availableLanguages: AvailableLanguageObject = { code: 'ru', display: 'pусский', }, - Slovak: { - code: 'sk', - display: 'Slovák', - }, sr: { code: 'sr', display: 'српски језик', @@ -153,14 +141,6 @@ export const availableLanguages: AvailableLanguageObject = { code: 'ko', display: '한국어', }, - id: { - code: 'id', - display: 'Bahasa Indonesia', - }, - tr: { - code: 'tr', - display: 'Türkçe', - }, uk: { code: 'uk', display: 'українська мова', diff --git a/src/i18n/locale/id.json b/src/i18n/locale/id.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/src/i18n/locale/id.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/i18n/locale/mi.json b/src/i18n/locale/mi.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/src/i18n/locale/mi.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/i18n/locale/sk.json b/src/i18n/locale/sk.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/src/i18n/locale/sk.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/i18n/locale/tr.json b/src/i18n/locale/tr.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/src/i18n/locale/tr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index c7fc29a93a..3bea11a1f0 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -28,8 +28,6 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { switch (locale) { case 'ar': return import('../i18n/locale/ar.json'); - case 'bg': - return import('../i18n/locale/bg.json'); case 'ca': return import('../i18n/locale/ca.json'); case 'cs': @@ -42,8 +40,6 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/el.json'); case 'es': return import('../i18n/locale/es.json'); - case 'fi': - return import('../i18n/locale/fi.json'); case 'fr': return import('../i18n/locale/fr.json'); case 'hr': @@ -52,16 +48,12 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/hu.json'); case 'it': return import('../i18n/locale/it.json'); - case 'id': - return import('../i18n/locale/id.json'); case 'ja': return import('../i18n/locale/ja.json'); case 'ko': return import('../i18n/locale/ko.json'); case 'lt': return import('../i18n/locale/lt.json'); - case 'mi': - return import('../i18n/locale/mi.json'); case 'nb-NO': return import('../i18n/locale/nb_NO.json'); case 'nl': @@ -74,8 +66,6 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/pt_PT.json'); case 'ru': return import('../i18n/locale/ru.json'); - case 'sk': - return import('../i18n/locale/sk.json'); case 'sq': return import('../i18n/locale/sq.json'); case 'sr': @@ -84,8 +74,6 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/sv.json'); case 'uk': return import('../i18n/locale/uk.json'); - case 'tr': - return import('../i18n/locale/tr.json'); case 'zh-CN': return import('../i18n/locale/zh_Hans.json'); case 'zh-TW': From 4a06fd6f8e07c20db7e2615c637ba9db96a2d3e3 Mon Sep 17 00:00:00 2001 From: Jordan Jones Date: Wed, 1 May 2024 08:20:22 -0500 Subject: [PATCH 5/5] fix: add back added langs --- src/context/LanguageContext.tsx | 15 +++++++++++++++ src/pages/_app.tsx | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/context/LanguageContext.tsx b/src/context/LanguageContext.tsx index 987da28e91..e362102827 100644 --- a/src/context/LanguageContext.tsx +++ b/src/context/LanguageContext.tsx @@ -13,6 +13,8 @@ export type AvailableLocale = | 'fi' | 'fr' | 'hr' + | 'he' + | 'hi' | 'hu' | 'it' | 'ja' @@ -23,6 +25,7 @@ export type AvailableLocale = | 'pl' | 'pt-BR' | 'pt-PT' + | 'ro' | 'ru' | 'sq' | 'sr' @@ -73,6 +76,14 @@ export const availableLanguages: AvailableLanguageObject = { code: 'fr', display: 'Français', }, + he: { + code: 'he', + display: 'Hebrew', + }, + hi: { + code: 'hi', + display: 'Hindi', + }, hr: { code: 'hr', display: 'Hrvatski', @@ -121,6 +132,10 @@ export const availableLanguages: AvailableLanguageObject = { code: 'el', display: 'Ελληνικά', }, + ro: { + code: 'ro', + display: 'Romanian', + }, ru: { code: 'ru', display: 'pусский', diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 3bea11a1f0..01ea14f925 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -28,6 +28,8 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { switch (locale) { case 'ar': return import('../i18n/locale/ar.json'); + case 'bg': + return import('../i18n/locale/bg.json'); case 'ca': return import('../i18n/locale/ca.json'); case 'cs': @@ -40,8 +42,14 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/el.json'); case 'es': return import('../i18n/locale/es.json'); + case 'fi': + return import('../i18n/locale/fi.json'); case 'fr': return import('../i18n/locale/fr.json'); + case 'he': + return import('../i18n/locale/he.json'); + case 'hi': + return import('../i18n/locale/hi.json'); case 'hr': return import('../i18n/locale/hr.json'); case 'hu': @@ -64,6 +72,8 @@ const loadLocaleData = (locale: AvailableLocale): Promise => { return import('../i18n/locale/pt_BR.json'); case 'pt-PT': return import('../i18n/locale/pt_PT.json'); + case 'ro': + return import('../i18n/locale/ro.json'); case 'ru': return import('../i18n/locale/ru.json'); case 'sq':