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; localStorage.locale = lang;
setPageLocale(); 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) { async changeCurrentPageLang(lang) {
let message = (await langModules["../lang/" + lang + ".json"]()).default; let message = (await langModules["../lang/" + lang + ".json"]()).default;
this.$i18n.setLocaleMessage(lang, message); this.$i18n.setLocaleMessage(lang, message);