From cf5fa4f9117d950c5e62654f82d8f657b4adddef Mon Sep 17 00:00:00 2001 From: luojiyin Date: Thu, 11 Jul 2024 23:04:23 +0800 Subject: [PATCH] git page i18n --- components/Git/ArticleEditor.tsx | 21 ++++++++++++--------- translation/en-US.ts | 10 ++++++++++ translation/zh-CN.ts | 10 ++++++++++ translation/zh-TW.ts | 10 ++++++++++ 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/components/Git/ArticleEditor.tsx b/components/Git/ArticleEditor.tsx index 2bc44da..8a62238 100644 --- a/components/Git/ArticleEditor.tsx +++ b/components/Git/ArticleEditor.tsx @@ -11,10 +11,12 @@ import { blobOf, formatDate, uniqueID } from 'web-utility'; import YAML from 'yaml'; import { GitRepositoryModel, userStore } from '../../models/Repository'; +import { i18n } from '../../models/Translation'; import { ListField } from '../Form/JSONEditor'; import { PathSelect } from './PathSelect'; import { RepositorySelect } from './RepositorySelect'; +const { t } = i18n; const HTMLEditor = dynamic(() => import('../Form/HTMLEditor'), { ssr: false }); export const fileType = { @@ -119,7 +121,6 @@ export class ArticleEditor extends Component { reset = () => { this.meta = null; - this.editorContent = ''; }; @@ -249,7 +250,7 @@ export class ArticleEditor extends Component { onSubmit={this.submit} > - + (this.repository = `${owner}/${name}`) @@ -257,14 +258,16 @@ export class ArticleEditor extends Component { /> - + {repository && ( )} - + @@ -272,16 +275,16 @@ export class ArticleEditor extends Component { sm={3} className="d-flex flex-wrap gap-2 justify-content-around align-items-center" > - + {meta && ( - + @@ -292,14 +295,14 @@ export class ArticleEditor extends Component { )}
- +