Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: #361 change placeholder and translate #383

Merged
merged 2 commits into from Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .babelrc.js
Expand Up @@ -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,}
],
]
}
16 changes: 15 additions & 1 deletion components/NewReplySection/ReplyForm/ReasonEditor.js
Expand Up @@ -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}
Expand Down
28 changes: 27 additions & 1 deletion i18n/zh_TW.po
Expand Up @@ -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 "延伸此回應來查核"

Expand Down Expand Up @@ -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"
Expand Down