Skip to content

Commit

Permalink
fix: 修改主页国际化 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
027xiguapi committed May 11, 2024
1 parent acb7573 commit ede54f5
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/web/src/components/card/pinImageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const PinImageCard = forwardRef((props: any, ref: any) => {
return (
<div className="cardContent" onClick={() => fileRef.current.click()}>
<PushpinOutlined className="cardIcon" />
<div className="cardTitle">贴图</div>
<div className="cardTitle">{t('home.pinImage')}</div>
<input
type="file"
ref={fileRef}
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/card/scanImageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SearchImageCard = forwardRef((props: any, ref: any) => {
return (
<div className="cardContent" onClick={() => fileRef.current.click()}>
<ScanOutlined className="cardIcon" />
<div className="cardTitle">扫码</div>
<div className="cardTitle">{t('home.scanCode')}</div>
<input
type="file"
ref={fileRef}
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/card/searchImageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const SearchImageCard = forwardRef((props: any, ref: any) => {
return (
<div className="cardContent" onClick={() => fileRef.current.click()}>
<SearchOutlined className="cardIcon" />
<div className="cardTitle">搜图</div>
<div className="cardTitle">{t('home.searchImage')}</div>
<input
type="file"
ref={fileRef}
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/card/spliceImageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const SpliceImageCard = forwardRef((props: any, ref: any) => {
return (
<div className="cardContent" onClick={handleSpliceImageClick}>
<AlignHorizontally className="cardIcon" />
<div className="cardTitle">图片拼接</div>
<div className="cardTitle">{t('home.spliceImage')}</div>
</div>
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/card/videoConverterCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const VideoConverterCard = forwardRef((props: any, ref: any) => {
return (
<div className="cardContent" onClick={handleOpenWin}>
<FileConversion className="cardIcon" />
<div className="cardTitle">视频转gif</div>
<div className="cardTitle">{t('home.converterGif')}</div>
</div>
);
});
Expand Down
10 changes: 9 additions & 1 deletion packages/web/src/i18n/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"print": "print"
},
"home": {
"main": "main",
"image": "image",
"video": "video",
"audioRecording": "Audioaufnahme",
"screenRecording": "Bildschirmaufnahme",
"videoRecording": "Videoaufnahme",
Expand All @@ -38,7 +41,12 @@
"editImg": "edit image",
"gif": "gif",
"edit": "edit",
"canvas": "canvas"
"canvas": "canvas",
"searchImage": "search image",
"pinImage": "pin image",
"converterGif": "converter gif",
"scanCode": "scan code",
"spliceImage": "splice image"
},
"editImage": {
"save": "speichern"
Expand Down
10 changes: 9 additions & 1 deletion packages/web/src/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"print": "print"
},
"home": {
"main": "main",
"image": "image",
"video": "video",
"audioRecording": "sound recording",
"screenRecording": "screen recording",
"videoRecording": "video recording",
Expand All @@ -42,7 +45,12 @@
"editImg": "edit image",
"gif": "gif",
"edit": "edit",
"canvas": "canvas"
"canvas": "canvas",
"searchImage": "search image",
"pinImage": "pin image",
"converterGif": "converter gif",
"scanCode": "scan code",
"spliceImage": "splice image"
},
"editImage": {
"save": "save"
Expand Down
10 changes: 9 additions & 1 deletion packages/web/src/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"print": "打印"
},
"home": {
"main": "首页",
"image": "图片",
"video": "视频",
"audioRecording": "录音",
"screenRecording": "录屏",
"videoRecording": "录像",
Expand All @@ -42,7 +45,12 @@
"editImg": "编辑图片",
"gif": "录动图",
"edit": "编辑",
"canvas": "画板"
"canvas": "画板",
"searchImage": "搜图",
"pinImage": "贴图",
"converterGif": "视频转gif",
"scanCode": "扫码",
"spliceImage": "图片拼接"
},
"editImage": {
"save": "保存"
Expand Down
20 changes: 5 additions & 15 deletions packages/web/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import HomeFooter from '../../components/home/HomeFooter';
import { db, defaultUser, defaultShortcut } from '../../db';
import ininitApp from '../../pages/main';
import styles from './index.module.scss';
import { useTranslation } from 'react-i18next';

const Home: React.FC = () => {
const { t } = useTranslation();
const cscRef = useRef(null);
const rscRef = useRef(null);
const rvcRef = useRef(null);
Expand Down Expand Up @@ -138,17 +140,17 @@ const Home: React.FC = () => {
{
key: 'main',
href: '#main',
title: '首页',
title: t('home.main'),
},
{
key: 'image',
href: '#image',
title: '图片',
title: t('home.image'),
},
{
key: 'video',
href: '#video',
title: '视频',
title: t('home.video'),
},
]}
/>
Expand Down Expand Up @@ -181,12 +183,6 @@ const Home: React.FC = () => {
<ViewAudioCard />
</Card.Grid>
<div id="image" />
{/*<Card.Grid style={gridStyle}>*/}
{/* <EditGifCard />*/}
{/*</Card.Grid>*/}
{/*<Card.Grid style={gridStyle}>*/}
{/* <ViewImageCard />*/}
{/*</Card.Grid>*/}
<Card.Grid style={gridStyle}>
<SearchImageCard user={user} />
</Card.Grid>
Expand All @@ -203,12 +199,6 @@ const Home: React.FC = () => {
<EditImageCard />
</Card.Grid>
<div id="video" />
{/*<Card.Grid style={gridStyle}>*/}
{/* <RecordVideoCard />*/}
{/*</Card.Grid>*/}
{/*<Card.Grid style={gridStyle}>*/}
{/* <RecordScreenCard />*/}
{/*</Card.Grid>*/}
<Card.Grid style={gridStyle}>
<VideoConverterCard />
</Card.Grid>
Expand Down

0 comments on commit ede54f5

Please sign in to comment.