Skip to content
Snippets Groups Projects
Commit a0ef06a1 authored by Julian's avatar Julian
Browse files

Load vuetify translations into vue-i18n

parent 6161df20
No related branches found
No related tags found
1 merge request!1244Resolve "Include correct Vuetify translations"
Pipeline #129172 failed
......@@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Fixed
~~~~~
* Default translations from vuetify were not loaded.
`3.0`_ - 2022-05-11
-------------------
......
......@@ -46,6 +46,7 @@ const vuetify = new Vuetify({
current: Vue.$cookies.get("django_language")
? Vue.$cookies.get("django_language")
: "en",
t: (key, ...params) => i18n.t(key, params),
},
...vuetifyOpts,
});
......@@ -89,5 +90,6 @@ const app = new Vue({
});
// Late setup for some plugins handed off to out ALeksisVue plugin
app.$loadVuetifyMessages();
app.$loadAppMessages();
app.$setupNavigationGuards();
......@@ -5,6 +5,7 @@
// aleksisAppImporter is a virtual module defined in Vite config
import { appMessages } from "aleksisAppImporter";
import aleksisMixin from "../mixins/aleksis.js";
import * as langs from "@/vuetify/src/locale";
console.debug("Defining AleksisVue plugin");
const AleksisVue = {};
......@@ -115,6 +116,15 @@ AleksisVue.install = function (Vue) {
}
};
/**
* Load vuetifys built-in translations
*/
Vue.prototype.$loadVuetifyMessages = function () {
for (const [locale, messages] of Object.entries(langs)) {
this.$i18n.mergeLocaleMessage(locale, { $vuetify: messages });
}
};
/**
* Invalidate state and force reload from server.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment