0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch.git synced 2024-12-22 05:12:57 -05:00

Add German and Ukrainian

This commit is contained in:
dragongoose 2023-10-04 17:44:14 -04:00
parent cd820a21f0
commit d3029fe9f4
No known key found for this signature in database
GPG key ID: 01397EEC371CDAA5
2 changed files with 8 additions and 4 deletions

View file

@ -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,
}
})

View file

@ -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'
},