mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-02 00:24:13 -05:00
* Translations + danish * changed back proxy target to use ENV * Resolved more merge conflicts * Removed test in translation * Documentation of translations * Updated translations * removed old packages Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
24 lines
623 B
JavaScript
24 lines
623 B
JavaScript
import Vue from 'vue'
|
|
import VueI18n from 'vue-i18n'
|
|
|
|
Vue.use(VueI18n)
|
|
|
|
function loadLocaleMessages () {
|
|
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
|
|
const messages = {}
|
|
locales.keys().forEach(key => {
|
|
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
|
if (matched && matched.length > 1) {
|
|
const locale = matched[1]
|
|
messages[locale] = locales(key)
|
|
}
|
|
})
|
|
return messages
|
|
}
|
|
|
|
export default new VueI18n({
|
|
locale: process.env.VUE_APP_I18N_LOCALE || 'en',
|
|
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en',
|
|
messages: loadLocaleMessages()
|
|
})
|