Update src/mixins/lang.js

Co-authored-by: Matthew Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
Wampie Driessen 2023-08-05 17:55:27 +02:00 committed by GitHub
parent 1ceb8e98d6
commit a50209b6c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,10 @@ export default {
localStorage.locale = lang;
setPageLocale();
},
/** Change the language for the current page (no localstore set) */
/**
* Change the language for the current page (no localstore set)
* @param {string} lang Code of language to switch to.
*/
async changeCurrentPageLang(lang) {
let message = (await langModules["../lang/" + lang + ".json"]()).default;
this.$i18n.setLocaleMessage(lang, message);