update i18n for layout

This commit is contained in:
JimmFly
2022-08-29 18:41:07 +08:00
parent bd9796bd25
commit db5a72f94f
14 changed files with 177 additions and 20 deletions
+40
View File
@@ -0,0 +1,40 @@
import i18next from 'i18next';
import { initReactI18next } from 'react-i18next';
import en_US from './resources/en.json';
import zh_CN from './resources/zh.json';
const resources = {
en: en_US,
zh: zh_CN,
} as const;
i18next.use(initReactI18next).init({
lng: 'en',
fallbackLng: 'en',
resources,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
});
export const options = [
{ value: 'en', text: 'English' },
{ value: 'zh', text: '简体中文' },
];
export { i18next };
// import { useTranslation } from 'react-i18next';
// import { options } from './i18n';
// <Select defaultValue="en" onChange={changeLanguage}>
// {options.map(option => (
// <Option key={option.value} value={option.value}>
// {option.text}
// </Option>
// ))}
// </Select>
// const { t, i18n } = useTranslation();
// const changeLanguage = (event: any) => {
// i18n.changeLanguage(event);
// };
@@ -0,0 +1,30 @@
{
"translation": {
"Paper": "Paper",
"Edgeless": "Edgeless",
"Sync to Disk": "Sync to Disk",
"Share": "Share",
"warningTips": {
"isNotfsApiSupported": "Welcome to the AFFiNE demo. To begin saving changes you can SYNC DATA TO DISK with the latest version of Chromium based browser like Chrome/Edge",
"isNotLocalWorkspace": "Welcome to the AFFiNE demo. To begin saving changes you can SYNC TO DISK.",
"DoNotStore": "AFFiNE is under active development and the current version is UNSTABLE. Please DO NOT store information or data"
},
"stetting": {
"Layout": {
"title": "Layout"
},
"Comment": {
"title": "Comment"
},
"Settings": {
"title": "Settings",
"Duplicate Page": "Duplicate Page",
"Copy Page Link": "Copy Page Link",
"Language": "Language",
"Clear Workspace": "Clear Workspace",
"Last edited by": "Last edited by ",
"Logout": "Logout"
}
}
}
}
@@ -0,0 +1,30 @@
{
"translation": {
"Paper": "页面",
"Edgeless": "无边缘",
"Sync to Disk": "同步到磁盘",
"Share": "分享",
"warningTips": {
"isNotfsApiSupported": "欢迎来到AFFiNE 的演示界面。您可以使用最新版本的基于Chrome的浏览器(如Chrome/Edge)将数据同步到磁盘来进行保存",
"isNotLocalWorkspace": "欢迎来到AFFiNE 的演示界面,您可以同步到磁盘来进行保存操作。",
"DoNotStore": "AFFINE 正在积极开发中,当前版本不稳定。请不要存储信息或数据。"
},
"stetting": {
"Layout": {
"title": "布局"
},
"Comment": {
"title": "评论"
},
"Settings": {
"title": "设置",
"Duplicate Page": "复制页面",
"Copy Page Link": "拷贝页面链接",
"Language": "当前语言",
"Clear Workspace": "清空工作区域",
"Last edited by": "最后编辑者为 ",
"Logout": "登出"
}
}
}
}