1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-27 07:31:46 +01:00
Files
dozzle/assets/modules/i18n.ts
Amir Raminfar c3b5991dc7 feat: implements a toast for alerting errors and other useful information (#2395)
* feat: implements a toast for alerting errors and other useful information

* removes unused code
2023-09-27 13:29:33 -07:00

21 lines
544 B
TypeScript

import { type App } from "vue";
import { createI18n } from "vue-i18n";
const messages = Object.fromEntries(
Object.entries(import.meta.glob<{ default: any }>("../../locales/*.y(a)?ml", { eager: true })).map(([key, value]) => {
const yaml = key.endsWith(".yaml");
return [key.slice(14, yaml ? -5 : -4), value.default];
}),
);
const i18n = createI18n({
legacy: false,
locale: navigator.language.slice(0, 2),
fallbackLocale: "en",
messages,
});
export const install = (app: App) => {
app.use(i18n);
};
export default i18n;