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