mirror of
https://github.com/sharevb/it-tools.git
synced 2026-12-01 09:22:15 +03:00
* 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>
25 lines
560 B
TypeScript
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;
|