diff --git a/src/i18n.ts b/src/i18n.ts index 4fd0f1b..150a22d 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -11,6 +11,8 @@ import cs from '@/locales/cs.json' import pl from '@/locales/pl.json' import it from '@/locales/it.json' import fr from '@/locales/fr.json' +import uk from '@/locales/uk.json' +import de from '@/locales/de.json' export default createI18n({ @@ -31,5 +33,7 @@ export default createI18n({ 'pl-PL': pl, 'it-IT': it, 'fr-FR': fr, + 'uk-UA': uk, + 'de-DE': de, } }) diff --git a/src/settingsManager.ts b/src/settingsManager.ts index ffcedf9..2ed0df1 100644 --- a/src/settingsManager.ts +++ b/src/settingsManager.ts @@ -1,8 +1,8 @@ +const locales = ['en-US', 'es-ES', 'nl-NL', 'pt-PT', 'fa-IR', 'he-IL', 'ru-RU', 'ko-KR', 'cs-CZ', 'pl-PL', 'it-IT', 'fr-FR', 'uk-UA', 'de-DE'] +const languages = ['English', 'Español', 'Nederlands', 'Português', 'فارسی', 'עִבְרִית', 'Русский', '한국어', 'Česky', 'Polski', 'Italia', 'Français', 'Українська', 'Deutsch'] + export const setLanguage = (selectedLanguage: string, i18n: any) => { // Locales and languages in arrays to match them - const locales = ['en-US', 'es-ES', 'nl-NL', 'pt-PT', 'fa-IR', 'he-IL', 'ru-RU', 'ko-KR', 'cs-CZ', 'pl-PL', 'it-IT', 'fr-FR'] - const languages = ['English', 'Español', 'Nederlands', 'Português', 'فارسی', 'עִבְרִית', 'Русский', '한국어', 'Česky', 'Polski', 'Italia', 'Français'] - const locale = locales[languages.indexOf(selectedLanguage)] localStorage.setItem("language", locale) i18n.locale = locale @@ -24,7 +24,7 @@ export function getDefaultSettings() { }, language: { name: 'language', - options: ['English', 'Español', 'Nederlands', 'Português', 'فارسی', 'עִבְרִית', 'Русский', '한국어', 'Česky', 'Polski', 'Italia', 'Français'], + options: languages, selected: 'English', type: 'option' },