refactor: provide global i18n function through the module
This commit is contained in:
@@ -115,6 +115,14 @@ export const changeAppLanguage = async (locale: string) => {
|
|||||||
setLocalConfig("locale", locale)
|
setLocalConfig("locale", locale)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the i18n instance
|
||||||
|
*/
|
||||||
|
export function getI18n() {
|
||||||
|
// @ts-expect-error Something weird with the i18n errors
|
||||||
|
return i18nInstance!.global.t
|
||||||
|
}
|
||||||
|
|
||||||
export default <HoppModule>{
|
export default <HoppModule>{
|
||||||
onVueAppInit(app) {
|
onVueAppInit(app) {
|
||||||
const i18n = createI18n(<I18nOptions>{
|
const i18n = createI18n(<I18nOptions>{
|
||||||
|
|||||||
Reference in New Issue
Block a user