Skip to content

Lazy Loading

Lazy loading is only valid in react , vue , solid , svelte

react

const t = useLocales({
zh: () => import("./locales/zh"),
en: () => import("./locales/en"),
});

vue , solid , svelte

const t = tLocales({
zh: () => import("./locales/zh"),
en: () => import("./locales/en"),
});

locales

./locales/en.ts

const en_locale = {
world: "World",
};
export default en_locale;

./locales/zh.ts

const zh_locale = {
world: "世界",
};
export default zh_locale;