jws-frontend/src/boot/i18n.ts
Methapon2001 90589b3daf
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 9s
chore: update deps
2025-03-26 11:51:27 +07:00

37 lines
1 KiB
TypeScript

import { defineBoot } from '#q-app/wrappers';
import { createI18n } from 'vue-i18n';
import messages from 'src/i18n';
export type MessageLanguages = keyof typeof messages;
// Type-define 'eng' as the master schema for the resource
export type MessageSchema = (typeof messages)['eng'];
// See https://vue-i18n.intlify.dev/guide/advanced/typescript.html#global-resource-schema-type-definition
/* eslint-disable @typescript-eslint/no-empty-interface */
declare module 'vue-i18n' {
// define the locale messages schema
export interface DefineLocaleMessage extends MessageSchema {}
// define the datetime format schema
export interface DefineDateTimeFormat {}
// define the number format schema
export interface DefineNumberFormat {}
}
/* eslint-enable @typescript-eslint/no-empty-interface */
export const i18n = createI18n<
{ message: MessageSchema },
MessageLanguages,
false
>({
locale: 'en-US',
legacy: false,
messages,
});
export default defineBoot(({ app }) => {
// Set i18n instance on app
app.use(i18n);
});