fix(i18n): 补齐九种语言的翻译并修复国际化检查
补齐页面缺译,统一动态文案的整句插值方式。
This commit is contained in:
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
Button,
|
||||
@@ -35,6 +37,8 @@ import { articleHeadings, sanitizeArticleHtml } from './insightsContent';
|
||||
import ArticleRichEditor from './ArticleRichEditor';
|
||||
|
||||
export default function ArticleEditor({ initial, insights, onApply, onClose }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [draft, setDraft] = useState(initial);
|
||||
const [errors, setErrors] = useState({});
|
||||
const [processingImage, setProcessingImage] = useState(false);
|
||||
@@ -96,7 +100,7 @@ export default function ArticleEditor({ initial, insights, onApply, onClose }) {
|
||||
footer={
|
||||
<div className='website-insights-editor-footer'>
|
||||
<div className='flex gap-2'>
|
||||
<Button onClick={close}>取消</Button>
|
||||
<Button onClick={close}>{t('取消')}</Button>
|
||||
<Button theme='solid' disabled={processingImage} onClick={apply}>
|
||||
{processingImage ? '图片处理中' : '保存'}
|
||||
</Button>
|
||||
@@ -185,11 +189,13 @@ export default function ArticleEditor({ initial, insights, onApply, onClose }) {
|
||||
'summary',
|
||||
'文章描述',
|
||||
<TextArea
|
||||
aria-label='文章描述'
|
||||
aria-label={t('文章描述')}
|
||||
validateStatus={errors.summary ? 'error' : 'default'}
|
||||
aria-invalid={Boolean(errors.summary)}
|
||||
value={draft.summary}
|
||||
placeholder='请输入文章描述,用于列表卡片摘要与详情页标题下方'
|
||||
placeholder={t(
|
||||
'请输入文章描述,用于列表卡片摘要与详情页标题下方',
|
||||
)}
|
||||
maxCount={200}
|
||||
rows={3}
|
||||
onChange={(value) => change('summary', value)}
|
||||
|
||||
@@ -16,6 +16,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TableEmpty from '../../components/common/table/TableEmpty';
|
||||
import TableToolbar from '../../components/common/table/TableToolbar';
|
||||
import { ConsoleFilterField } from '../../components/console/ConsoleModuleFilters';
|
||||
@@ -47,6 +49,8 @@ import {
|
||||
import ArticleEditor from './ArticleEditor';
|
||||
|
||||
export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [keyword, setKeyword] = useState('');
|
||||
const [category, setCategory] = useState('all');
|
||||
const [managing, setManaging] = useState(false);
|
||||
@@ -188,7 +192,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
setArticle({ ...item, related: [...item.related] })
|
||||
}
|
||||
>
|
||||
编辑
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
@@ -198,7 +202,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
disabled={disabled || !sortable || index <= 0}
|
||||
onClick={() => move(-1)}
|
||||
>
|
||||
上移
|
||||
{t('上移')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
@@ -210,7 +214,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
}
|
||||
onClick={() => move(1)}
|
||||
>
|
||||
下移
|
||||
{t('下移')}
|
||||
</Button>
|
||||
<Button
|
||||
type='link'
|
||||
@@ -219,7 +223,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
disabled={disabled}
|
||||
onClick={() => deleteArticle(item)}
|
||||
>
|
||||
删除
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
@@ -251,7 +255,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
disabled={disabled}
|
||||
onClick={() => setManaging(true)}
|
||||
>
|
||||
管理分类
|
||||
{t('管理分类')}
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
@@ -303,7 +307,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
disabled={disabled}
|
||||
onClick={() => editCategory()}
|
||||
>
|
||||
新增分类
|
||||
{t('新增分类')}
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
@@ -345,7 +349,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
setArticle(newArticle(activeCategory));
|
||||
}}
|
||||
>
|
||||
新增文章
|
||||
{t('新增文章')}
|
||||
</Button>
|
||||
</div>
|
||||
</TableToolbar>
|
||||
@@ -376,7 +380,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
disabled={disabled}
|
||||
onClick={() => editCategory()}
|
||||
>
|
||||
新增分类
|
||||
{t('新增分类')}
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
@@ -384,7 +388,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
“全部内容”为官网默认筛选项,汇总展示全部文章,不能作为文章分类;已有文章的分类需先将文章调整到其他分类再删除。
|
||||
</Typography.Paragraph>
|
||||
<div className='website-insights-manage-row'>
|
||||
<span>全部内容</span>
|
||||
<span>{t('全部内容')}</span>
|
||||
<Typography.Text type='tertiary'>
|
||||
默认筛选项(不可删除)
|
||||
</Typography.Text>
|
||||
@@ -392,7 +396,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
{value.categories.map((c) => (
|
||||
<div className='website-insights-manage-row' key={c.id}>
|
||||
<span>
|
||||
{c.name}({count(c.id)} 篇)
|
||||
{c.name}({count(c.id)} {t('篇)')}
|
||||
</span>
|
||||
<Button
|
||||
type='tertiary'
|
||||
@@ -400,7 +404,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
disabled={disabled}
|
||||
onClick={() => editCategory(c)}
|
||||
>
|
||||
编辑
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Button
|
||||
theme='borderless'
|
||||
@@ -408,7 +412,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
disabled={disabled}
|
||||
onClick={() => deleteCategory(c)}
|
||||
>
|
||||
删除
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</div>
|
||||
))}
|
||||
@@ -433,7 +437,7 @@ export default function InsightsPanel({ value, onChange, disabled, error }) {
|
||||
htmlFor='website-category-name'
|
||||
className='website-category-dialog-label'
|
||||
>
|
||||
分类名称 <span aria-hidden='true'>*</span>
|
||||
{t('分类名称')} <span aria-hidden='true'>*</span>
|
||||
</label>
|
||||
<Input
|
||||
id='website-category-name'
|
||||
|
||||
Reference in New Issue
Block a user