Skip to content

Commit e13c3c7

Browse files
committed
feat: Dynamic i18n
1 parent aa77de1 commit e13c3c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

i18n/request.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ export default getRequestConfig(async ({ requestLocale }) => {
1010
locale = routing.defaultLocale;
1111
}
1212

13+
const res = await fetch(`${process.env.I18N_PUBLIC_URL}/${locale}.json`);
14+
1315
return {
1416
locale,
15-
messages: (await import(`@/messages/${locale}.json`)).default,
17+
messages: await res.json(),
1618
};
1719
});

0 commit comments

Comments
 (0)