4.3. 转换页面
页面使用 i18next 库进行转换。您可以根据其 [website](https://react.i18next.com/)进行设置。如果要使用提供的翻译,则需要将 i18next-fetch-backend 添加到项目中并添加:
backend: {
loadPath: `http://localhost:8080/resources/master/account/{lng}}`,
parse: (data: string) => {
const messages = JSON.parse(data);
return Object.fromEntries(
messages.map(({ key, value }) => [key, value])
);
},
},