Skip to content

Commit

Permalink
feat: add env variable to set the languages
Browse files Browse the repository at this point in the history
  • Loading branch information
tjorbo committed Dec 11, 2023
1 parent a950bd4 commit 67f11dc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
VUE_APP_I18N_LOCALE=de
VUE_APP_I18N_FALLBACK_LOCALE=en
VUE_APP_MUSEUMSCARD=false
VUE_APP_LANGUAGES=de,en,da
VUE_APP_NEW_API=false
VUE_APP_TENANT=sh
VUE_APP_MATOMO=true
Expand Down
1 change: 1 addition & 0 deletions .env.hb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
VUE_APP_I18N_LOCALE=de
VUE_APP_I18N_FALLBACK_LOCALE=en
VUE_APP_MUSEUMSCARD=false
VUE_APP_LANGUAGES=de,en
VUE_APP_NEW_API=true
VUE_APP_TENANT=hb
VUE_APP_MATOMO=false
Expand Down
30 changes: 18 additions & 12 deletions src/components/dashboard/LocaleChanger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,24 @@ export default {
data() {
return {
locales: {
de: {
icon: localeIconDeutsch,
name: i18n.t('locales.de.name')
},
en: {
icon: localeIconEnglish,
name: i18n.t('locales.en.name')
},
da: {
icon: localeIconDansk,
name: i18n.t('locales.da.name')
}
...(process.env.VUE_APP_LANGUAGES.includes('de') && {
de: {
icon: localeIconDeutsch,
name: i18n.t('locales.de.name')
}
}),
...(process.env.VUE_APP_LANGUAGES.includes('en') && {
en: {
icon: localeIconEnglish,
name: i18n.t('locales.en.name')
}
}),
...(process.env.VUE_APP_LANGUAGES.includes('da') && {
da: {
icon: localeIconDansk,
name: i18n.t('locales.da.name')
}
})
}
}
},
Expand Down

0 comments on commit 67f11dc

Please sign in to comment.