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
@@ -12,6 +12,7 @@ import {
useShowSettingsSidebar,
} from '@toeverything/datasource/state';
import { useTranslation } from 'react-i18next';
import { EditorBoardSwitcher } from './EditorBoardSwitcher';
import { FileSystem, fsApiSupported } from './FileSystem';
import { CurrentPageTitle } from './Title';
@@ -20,16 +21,17 @@ export const LayoutHeader = () => {
const [isLocalWorkspace] = useLocalTrigger();
const { toggleSettingsSidebar: toggleInfoSidebar, showSettingsSidebar } =
useShowSettingsSidebar();
const { t } = useTranslation();
const warningTips = useMemo(() => {
if (!fsApiSupported()) {
return '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';
return t('warningTips.isNotfsApiSupported');
} else if (!isLocalWorkspace) {
return 'Welcome to the AFFiNE demo. To begin saving changes you can SYNC TO DISK.';
return t('warningTips.isNotLocalWorkspace');
} else {
return 'AFFiNE is under active development and the current version is UNSTABLE. Please DO NOT store information or data';
return t('warningTips.DoNotStore');
}
}, [isLocalWorkspace]);
}, [isLocalWorkspace, t]);
return (
<StyledContainerForHeaderRoot>
@@ -43,7 +45,7 @@ export const LayoutHeader = () => {
<FlexContainer>
<StyledHelper>
<FileSystem />
<StyledShare disabled={true}>Share</StyledShare>
<StyledShare disabled={true}>{t('Share')}</StyledShare>
<div style={{ margin: '0px 12px' }}>
<IconButton
size="large"