mirror of
https://github.com/owntracks/frontend.git
synced 2026-08-23 11:26:16 +00:00
This includes a major version bump of ESLint and Prettier, so also some reformatting.
24 lines
551 B
JavaScript
24 lines
551 B
JavaScript
import Vue from "vue";
|
|
import VueI18n from "vue-i18n";
|
|
|
|
import config from "@/config";
|
|
|
|
Vue.use(VueI18n);
|
|
|
|
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);
|
|
}
|
|
});
|
|
|
|
export default new VueI18n({
|
|
locale: config.locale.split("-")[0],
|
|
fallbackLocale: "en",
|
|
formatFallbackMessages: true,
|
|
messages,
|
|
});
|