feat: setup monorepo for static frontend app (vdn-static)
This commit is contained in:
parent
1049d26a3d
commit
4eefaa7cba
48 changed files with 3219 additions and 337 deletions
17
apps/vdn-static/src/i18n/index.ts
Normal file
17
apps/vdn-static/src/i18n/index.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { createI18n } from "vue-i18n";
|
||||
import en_US from "../locales/en_US";
|
||||
import vp_VL from "../locales/vp_VL";
|
||||
import type { MessageSchema } from "./types";
|
||||
|
||||
const locales = { en_US, vp_VL } as const;
|
||||
|
||||
export type Locale = keyof typeof locales;
|
||||
|
||||
const i18n = createI18n<[MessageSchema], Locale>({
|
||||
legacy: false,
|
||||
locale: "vp_VL" satisfies Locale,
|
||||
fallbackLocale: "en_US" satisfies Locale,
|
||||
messages: locales,
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
8
apps/vdn-static/src/i18n/types.ts
Normal file
8
apps/vdn-static/src/i18n/types.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import en_US from "../locales/en_US";
|
||||
export interface MessageSchema extends Broaden<typeof en_US> {}
|
||||
|
||||
type Broaden<T> = {
|
||||
[K in keyof T]: T[K] extends object ? Broaden<T[K]>
|
||||
: T[K] extends string ? string
|
||||
: T[K];
|
||||
} & {};
|
||||
Loading…
Add table
Add a link
Reference in a new issue