Files
it-tools/src/plugins/i18n.plugin.ts
T
lionel-roweandShareVB 102cfce37b Use async versions of bcrypt methods to avoid freezing browser tab (#204)
* Use async versions of bcrypt methods to avoid freezing browser tab

* Update bcryptjs to 3.0.3 and remove setInterval workaround

* extract tools strings enhancements

* i18n plugin optimization
---------

Co-authored-by: ShareVB <sharevb@gmail.com>
2025-11-13 00:55:29 +01:00

25 lines
560 B
TypeScript

import messages from '@intlify/unplugin-vue-i18n/messages';
import { get } from '@vueuse/core';
import type { Plugin } from 'vue';
import { createI18n } from 'vue-i18n';
const DEFAULT_LOCALE = String(import.meta.env.VITE_LANGUAGE || 'en');
const i18n = createI18n({
legacy: false,
locale: DEFAULT_LOCALE,
messages,
});
export const i18nPlugin: Plugin = {
install: (app) => {
app.use(i18n);
},
};
export function getCurrentLocale(): string {
return get(i18n.global.locale);
}
export const translate = i18n.global.t as typeof i18n.global.t;