mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 17:48:51 +02:00
fix:#5 readded missing locale function for dom
This commit is contained in:
@ -20,6 +20,18 @@ function setup() {
|
|||||||
return _i18n;
|
return _i18n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sets the active locale.
|
||||||
|
function setLocale(newLocale: any) {
|
||||||
|
_i18n.global.locale = newLocale;
|
||||||
|
setDocumentAttributesFor(newLocale);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setDocumentAttributesFor(locale: any) {
|
||||||
|
const htmlElement = document.querySelector("html");
|
||||||
|
|
||||||
|
htmlElement?.setAttribute("lang", locale);
|
||||||
|
}
|
||||||
|
|
||||||
// Public interface
|
// Public interface
|
||||||
export default {
|
export default {
|
||||||
// Expose the VueI18n instance via a getter
|
// Expose the VueI18n instance via a getter
|
||||||
@ -27,4 +39,5 @@ export default {
|
|||||||
return _i18n;
|
return _i18n;
|
||||||
},
|
},
|
||||||
setup,
|
setup,
|
||||||
|
setLocale,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user