From 0be1cfa20929f6f3851016edb6d36d12d2fdd73e Mon Sep 17 00:00:00 2001 From: Ula Chao Date: Sun, 24 Jan 2021 02:10:21 +0800 Subject: [PATCH 1/2] feat(.babelrc): support multiline in ttag ref: https://ttag.js.org/docs/plugin-api.html#configdedent --- .babelrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.babelrc.js b/.babelrc.js index e742e3f7..2abdda91 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -19,7 +19,7 @@ module.exports = { "@babel/plugin-proposal-class-properties", // ttag extraction & resolve needs it, even though it's included in next/babel... "@babel/plugin-proposal-optional-chaining", [ // Need to be put last so that it can replace all strings - 'ttag', {resolve: {translations: `i18n/${process.env.LOCALE || 'en_US'}.po`}} + 'ttag', {resolve: {translations: `i18n/${process.env.LOCALE || 'en_US'}.po`}, dedent: true,} ], ] } \ No newline at end of file From 481a33e58ef3e83033d76c86cc33770860490d54 Mon Sep 17 00:00:00 2001 From: Ula Chao Date: Sun, 24 Jan 2021 02:11:35 +0800 Subject: [PATCH 2/2] enhance(ReasonEditor): #361 better placeholder content --- .../NewReplySection/ReplyForm/ReasonEditor.js | 16 ++++++++++- i18n/zh_TW.po | 28 ++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/components/NewReplySection/ReplyForm/ReasonEditor.js b/components/NewReplySection/ReplyForm/ReasonEditor.js index 7265d517..16bbebef 100644 --- a/components/NewReplySection/ReplyForm/ReasonEditor.js +++ b/components/NewReplySection/ReplyForm/ReasonEditor.js @@ -257,7 +257,21 @@ const ReasonEditor = ({ required className={classes.inputArea} ref={editorRef} - placeholder="140 字以內" + placeholder={(() => { + if (replyType === 'NOT_ARTICLE') { + return t`Please briefly explain why this message should not be processed in Cofacts.`; + } else if (replyType === 'NOT_RUMOR') { + return t`As a brief intro for the references, please point out which part of the message is correct.`; + } else if (replyType === 'OPINIONATED') { + return t`Please briefly +1. explain which part of the message contains personal opinion +2. remind the audience that this is not factual`; + } else if (replyType === 'RUMOR') { + return t`As a brief intro for the references, please point out which part of the message is incorrect.`; + } else { + return ''; + } + })()} onChange={handleChange} onKeyDown={handleKeyPress} value={value} diff --git a/i18n/zh_TW.po b/i18n/zh_TW.po index 7abf2366..e5ebde44 100644 --- a/i18n/zh_TW.po +++ b/i18n/zh_TW.po @@ -679,7 +679,7 @@ msgstr "撰寫新回應" msgid "Use existing replies" msgstr "使用現有回應" -#: components/NewReplySection/ReplyForm/ReasonEditor.js:290 +#: components/NewReplySection/ReplyForm/ReasonEditor.js:304 msgid "Keep composing my reply with this" msgstr "延伸此回應來查核" @@ -1049,6 +1049,32 @@ msgstr "資料佐證" msgid "Source URL" msgstr "連結網址" +#: components/NewReplySection/ReplyForm/ReasonEditor.js:262 +msgid "Please briefly explain why this message should not be processed in Cofacts." +msgstr "請簡單說明為何 Cofacts 不該處理這則訊息" + +#: components/NewReplySection/ReplyForm/ReasonEditor.js:264 +msgid "" +"As a brief intro for the references, please point out which part of the " +"message is correct." +msgstr "請簡單說明它哪個部分是正確的,作為「資料來源」的導讀" + +#: components/NewReplySection/ReplyForm/ReasonEditor.js:266 +msgid "" +"Please briefly\n" +"1. explain which part of the message contains personal opinion\n" +"2. remind the audience that this is not factual" +msgstr "" +"請簡單說明:\n" +"1. 它哪個部分含有主觀意見之處\n" +"2. 提醒讀者這不是客觀事實" + +#: components/NewReplySection/ReplyForm/ReasonEditor.js:270 +msgid "" +"As a brief intro for the references, please point out which part of the " +"message is incorrect." +msgstr "請簡單說明不實之處,作為「資料來源」的導讀" + #: pages/index.js:41 msgctxt "site title" msgid "Cofacts"