refactor: provide global i18n function through the module

This commit is contained in:
Andrew Bastin
2023-07-03 11:39:00 +05:30
parent edf57da9be
commit 38215be3bd

View File

@@ -115,6 +115,14 @@ export const changeAppLanguage = async (locale: string) => {
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>{
onVueAppInit(app) {
const i18n = createI18n(<I18nOptions>{