From 8cfb573bb382997f5c07f44780fd87f6d097c064 Mon Sep 17 00:00:00 2001 From: robin Date: Fri, 30 Sep 2022 17:17:41 +0800 Subject: [PATCH] refactor: adjust the content of the sidebar display --- ui/src/i18n/locales/en.json | 48 +++-------------- ui/src/pages/Questions/Ask/index.tsx | 58 +++++---------------- ui/src/pages/Questions/EditAnswer/index.tsx | 35 ++++--------- ui/src/pages/Tags/Edit/index.tsx | 18 ++++--- 4 files changed, 41 insertions(+), 118 deletions(-) diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json index f016ca9e..a09206f3 100644 --- a/ui/src/i18n/locales/en.json +++ b/ui/src/i18n/locales/en.json @@ -1,4 +1,8 @@ { + "how_to_format": { + "title": "How to Format", + "description": "" + }, "pagination": { "prev": "Prev", "next": "Next" @@ -272,11 +276,7 @@ } }, "btn_save_edits": "Save edits", - "btn_cancel": "Cancel", - "how_to_format": { - "title": "How to Format", - "description": "This is some text within a card body." - } + "btn_cancel": "Cancel" }, "dates": { "long_date": "MMM D", @@ -318,23 +318,7 @@ } }, "btn_save_edits": "Save edits", - "btn_cancel": "Cancel", - "how_to_ask": { - "title": "How to Ask", - "description": "Not sure what to ask? Recurring questions, onboarding procedures, local setups, and FAQs all make for useful questions." - }, - "how_to_format": { - "title": "How to Format", - "description": "This is some text within a card body." - }, - "how_to_tag": { - "title": "How to Tag", - "description": "A tag helps ensure that your question will get attention from the right people. Here are tagging tips:", - "tips": [ - "If you’re not sure what tags to use, check out popular tags.", - "Tag things in more than one way so people can find them more easily. Add tags for product lines, projects, teams, and the specific technologies or languages used." - ] - } + "btn_cancel": "Cancel" }, "tags": { "title": "Tags", @@ -390,23 +374,7 @@ "btn_post_question": "Post your question", "btn_save_edits": "Save edits", "answer_question": "Answer your own question", - "post_question&answer": "Post your question and answer", - "how_to_ask": { - "title": "How to Ask", - "description": "Not sure what to ask? Recurring questions, onboarding procedures, local setups, and FAQs all make for useful questions." - }, - "how_to_format": { - "title": "How to Format", - "description": "This is some text within a card body." - }, - "how_to_tag": { - "title": "How to Tag", - "description": "A tag helps ensure that your question will get attention from the right people. Here are tagging tips:", - "tips": [ - "If you’re not sure what tags to use, check out popular tags.", - "Tag things in more than one way so people can find them more easily. Add tags for product lines, projects, teams, and the specific technologies or languages used." - ] - } + "post_question&answer": "Post your question and answer" }, "tag_selector": { "add_btn": "Add tag", @@ -874,4 +842,4 @@ } } } -} +} \ No newline at end of file diff --git a/ui/src/pages/Questions/Ask/index.tsx b/ui/src/pages/Questions/Ask/index.tsx index b6b3966c..9cff9604 100644 --- a/ui/src/pages/Questions/Ask/index.tsx +++ b/ui/src/pages/Questions/Ask/index.tsx @@ -63,7 +63,6 @@ const Ask = () => { const { qid } = useParams(); const navigate = useNavigate(); const { t } = useTranslation('translation', { keyPrefix: 'ask' }); - const { t: t2 } = useTranslation('translation', { keyPrefix: 'dates' }); const isEdit = qid !== undefined; const { data: similarQuestions = { list: [] } } = useQueryQuestionByTitle( @@ -282,7 +281,7 @@ const Ask = () => { {revisions.map(({ reason, create_at }, index) => { const date = dayjs(create_at * 1000).format( - t2('long_date_with_time'), + t('long_date_with_time', { keyPrefix: 'dates' }), ); return (