Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

refactor(i18n): Rewrite description as desc to be compatible with go-i18n

haitao(lj)c2e72d106e16
diff --git a/ui/src/hooks/useChangeModal/index.tsx b/ui/src/hooks/useChangeModal/index.tsx
index 767618b6..f597e6ab 100644
--- a/ui/src/hooks/useChangeModal/index.tsx
+++ b/ui/src/hooks/useChangeModal/index.tsx
@@ -35,22 +35,22 @@ const useChangeModal = ({ callback }: Props) => {
{
type: 'normal',
name: t('normal_name'),
- description: t('normal_description'),
+ description: t('normal_desc'),
},
{
type: 'suspended',
name: t('suspended_name'),
- description: t('suspended_description'),
+ description: t('suspended_desc'),
},
{
type: 'deleted',
name: t('deleted_name'),
- description: t('deleted_description'),
+ description: t('deleted_desc'),
},
{
type: 'inactive',
name: t('inactive_name'),
- description: t('inactive_description'),
+ description: t('inactive_desc'),
},
]);
diff --git a/ui/src/hooks/useEditStatusModal/index.tsx b/ui/src/hooks/useEditStatusModal/index.tsx
index 54a246ba..d2f4147e 100644
--- a/ui/src/hooks/useEditStatusModal/index.tsx
+++ b/ui/src/hooks/useEditStatusModal/index.tsx
@@ -27,17 +27,17 @@ const useEditStatusModal = ({
{
type: 'normal',
name: t('normal_name'),
- description: t('normal_description'),
+ description: t('normal_desc'),
},
{
type: 'closed',
name: t('closed_name'),
- description: t('closed_description'),
+ description: t('closed_desc'),
},
{
type: 'deleted',
name: t('deleted_name'),
- description: t('deleted_description'),
+ description: t('deleted_desc'),
},
]);
diff --git a/ui/src/hooks/useTagModal/index.tsx b/ui/src/hooks/useTagModal/index.tsx
index d4fbef7e..99ea8b56 100644
--- a/ui/src/hooks/useTagModal/index.tsx
+++ b/ui/src/hooks/useTagModal/index.tsx
@@ -204,15 +204,13 @@ const useTagModal = (props: IProps = {}) => {
isInvalid={formData.slugName.isInvalid}
/>
- <Form.Text as="div">
- {t('form.fields.slug_name.description')}
- </Form.Text>
+ <Form.Text as="div">{t('form.fields.slug_name.desc')}</Form.Text>
<Form.Control.Feedback type="invalid">
{formData.slugName.errorMsg}
</Form.Control.Feedback>
</Form.Group>
<Form.Group controlId="description">
- <Form.Label>{t('form.fields.description.label')}</Form.Label>
+ <Form.Label>{t('form.fields.desc.label')}</Form.Label>
<Form.Control
className="font-monospace"
value={formData.description.value}
diff --git a/ui/src/pages/404/index.jsx b/ui/src/pages/404/index.jsx
index f33555ac..d2aa8a85 100644
--- a/ui/src/pages/404/index.jsx
+++ b/ui/src/pages/404/index.jsx
@@ -11,7 +11,7 @@ const Index = () => {
style={{ fontSize: '120px', lineHeight: 1.2 }}>
(=‘x‘=)
</div>
- <div className="text-center mb-4">{t('description')}</div>
+ <div className="text-center mb-4">{t('desc')}</div>
<div className="text-center">
<Button as={Link} to="/" variant="link">
{t('back_home')}
diff --git a/ui/src/pages/50X/index.jsx b/ui/src/pages/50X/index.jsx
index dbf6a6f9..744c403c 100644
--- a/ui/src/pages/50X/index.jsx
+++ b/ui/src/pages/50X/index.jsx
@@ -11,7 +11,7 @@ const Index = () => {
style={{ fontSize: '120px', lineHeight: 1.2 }}>
(=T^T=)
</div>
- <div className="text-center mb-3">{t('description')}</div>
+ <div className="text-center mb-3">{t('desc')}</div>
<div className="text-center">
<Button as={Link} to="/" variant="link">
{t('back_home')}
diff --git a/ui/src/pages/Admin/General/index.tsx b/ui/src/pages/Admin/General/index.tsx
index 289ceb56..6e97b952 100644
--- a/ui/src/pages/Admin/General/index.tsx
+++ b/ui/src/pages/Admin/General/index.tsx
@@ -33,13 +33,13 @@ const General: FC = () => {
},
short_description: {
type: 'string',
- title: t('short_description.label'),
- description: t('short_description.text'),
+ title: t('short_desc.label'),
+ description: t('short_desc.text'),
},
description: {
type: 'string',
- title: t('description.label'),
- description: t('description.text'),
+ title: t('desc.label'),
+ description: t('desc.text'),
},
contact_email: {
type: 'string',
diff --git a/ui/src/pages/Questions/Ask/index.tsx b/ui/src/pages/Questions/Ask/index.tsx
index fe074951..84673764 100644
--- a/ui/src/pages/Questions/Ask/index.tsx
+++ b/ui/src/pages/Questions/Ask/index.tsx
@@ -467,7 +467,7 @@ const Ask = () => {
<Card.Body
className="fmt small"
dangerouslySetInnerHTML={{
- __html: t('description', { keyPrefix: 'how_to_format' }),
+ __html: t('desc', { keyPrefix: 'how_to_format' }),
}}
/>
</Card>
diff --git a/ui/src/pages/Tags/Detail/index.tsx b/ui/src/pages/Tags/Detail/index.tsx
index 763341ef..ea9a04e3 100644
--- a/ui/src/pages/Tags/Detail/index.tsx
+++ b/ui/src/pages/Tags/Detail/index.tsx
@@ -73,7 +73,7 @@ const Questions: FC = () => {
</h3>
<p className="text-break">
- {escapeRemove(tagInfo.excerpt) || t('no_description')}
+ {escapeRemove(tagInfo.excerpt) || t('no_desc')}
<Link to={pathFactory.tagInfo(curTagName)} className="ms-1">
[{t('more')}]
</Link>
diff --git a/ui/src/pages/Tags/Edit/index.tsx b/ui/src/pages/Tags/Edit/index.tsx
index d7f508b3..01f91e6d 100644
--- a/ui/src/pages/Tags/Edit/index.tsx
+++ b/ui/src/pages/Tags/Edit/index.tsx
@@ -203,7 +203,7 @@ const Ask = () => {
</Form.Group>
<Form.Group controlId="description" className="mt-4">
- <Form.Label>{t('form.fields.description.label')}</Form.Label>
+ <Form.Label>{t('form.fields.desc.label')}</Form.Label>
<Editor
value={formData.description.value}
onChange={handleDescriptionChange}
@@ -260,7 +260,7 @@ const Ask = () => {
<Card.Body
className="fmt small"
dangerouslySetInnerHTML={{
- __html: t('description', { keyPrefix: 'how_to_format' }),
+ __html: t('desc', { keyPrefix: 'how_to_format' }),
}}
/>
</Card>