diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 13163791..f2031a99 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -11,6 +11,11 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + inputs: + DOCKER_BUILD_CACHE_BUST: + description: 'Cache busting parameter for Docker build' + required: false + default: '' # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -74,8 +79,9 @@ jobs: "LOCALE=${{ matrix.locales.locale }}" # Cache for individual languages # Ref: https://docs.docker.com/build/cache/backends/gha/#scope - cache-from: type=gha,scope=${{env.GITHUB_REF_NAME}}${{matrix.locales.postfix}} - cache-to: type=gha,mode=max,scope=${{env.GITHUB_REF_NAME}}${{matrix.locales.postfix}} + # Cache busting idea from: https://stackoverflow.com/a/64819132 to handle i18n update issue + cache-from: type=gha,scope=${{env.GITHUB_REF_NAME}}${{matrix.locales.postfix}}${{inputs.DOCKER_BUILD_CACHE_BUST}} + cache-to: type=gha,mode=max,scope=${{env.GITHUB_REF_NAME}}${{matrix.locales.postfix}}${{inputs.DOCKER_BUILD_CACHE_BUST}} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/i18n/ja.po b/i18n/ja.po index c05682aa..31f9ad54 100644 --- a/i18n/ja.po +++ b/i18n/ja.po @@ -6,40 +6,40 @@ msgstr "" "mime-version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" -#: src/webhook/handlers/utils.ts:94 +#: src/webhook/handlers/utils.ts:98 msgid "No feedback yet" msgstr "まだリプライはありません" -#: src/webhook/handlers/utils.ts:108 +#: src/webhook/handlers/utils.ts:112 msgid "${ negative } user consider this not useful" msgid_plural "${ negative } users consider this not useful" msgstr[0] "${negative} 人がこのリプライは役に立っていないと思っています" -#: src/lib/sharedUtils.js:79 +#: src/lib/sharedUtils.js:87 msgid "Contains misinformation" msgstr "事実じゃない情報が含まれています" -#: src/lib/sharedUtils.js:81 +#: src/lib/sharedUtils.js:89 msgid "Contains true information" msgstr "事実が含まれています" -#: src/lib/sharedUtils.js:83 +#: src/lib/sharedUtils.js:91 msgid "Contains personal perspective" msgstr "個人の意見が含まれています" -#: src/lib/sharedUtils.js:85 +#: src/lib/sharedUtils.js:93 msgid "Invalid request" msgstr "検証の範囲外" -#: src/webhook/handlers/utils.ts:135 +#: src/webhook/handlers/utils.ts:139 msgid "different opinions" msgstr "違う観点" -#: src/webhook/handlers/utils.ts:135 +#: src/webhook/handlers/utils.ts:139 msgid "references" msgstr "情報源" -#: src/webhook/handlers/utils.ts:141 +#: src/webhook/handlers/utils.ts:145 #, javascript-format msgid "This reply has no ${ prompt } and it may be biased" msgstr "このリプライは${prompt}がありませんので、信頼性を見直す必要があります。" @@ -61,11 +61,11 @@ msgstr "見てみましょう" msgid "Visit ${ articleUrl } for more replies." msgstr "他のリプライを見たい場合、こちらに:${ articleUrl }" -#: src/webhook/handlers/utils.ts:1113 +#: src/webhook/handlers/utils.ts:1195 msgid "Choose this one" msgstr "これを選ぶ" -#: src/webhook/handlers/askingCooccurrence.ts:185 +#: src/webhook/handlers/askingCooccurrence.ts:257 #: src/webhook/handlers/initState.ts:188 #: src/webhook/handlers/processMedia.ts:150 #. Get first few search results for each message, and make at most 10 options @@ -77,36 +77,36 @@ msgstr "" "デマ情報はよく何度も編集され発送されます。\n" "最も関連するバージョンを選んでください" -#: src/webhook/handlers/utils.ts:658 +#: src/webhook/handlers/utils.ts:733 #, javascript-format msgid "Therefore, the author think the message ${ typeStr }." msgstr "以上により、リプライ者が次のように考えています ${typeStr}。" -#: src/webhook/handlers/utils.ts:661 +#: src/webhook/handlers/utils.ts:736 msgid "" "There are different replies for the message. Read them all here before " "making judgements:" msgstr "この情報に様々なリプライがあるため、読み通してから判断するようにお薦めします:" -#: src/webhook/handlers/utils.ts:663 +#: src/webhook/handlers/utils.ts:738 msgid "If you have different thoughts, you may have your say here:" msgstr "違う見方をお持ちの方は、どうぞ気軽に新規リプライを投稿してください:" #: src/liff/components/FeedbackForm.svelte:23 #: src/webhook/handlers/choosingReply.ts:48 -#: src/webhook/handlers/choosingReply.ts:197 +#: src/webhook/handlers/choosingReply.ts:213 msgid "Is the reply helpful?" msgstr "以上のリプライは役に立ちましたか?" #: src/liff/components/FeedbackForm.svelte:27 #: src/webhook/handlers/choosingReply.ts:63 -#: src/webhook/handlers/processBatch.ts:31 +#: src/webhook/handlers/processBatch.ts:48 msgid "Yes" msgstr "はい" #: src/liff/components/FeedbackForm.svelte:30 #: src/webhook/handlers/choosingReply.ts:73 -#: src/webhook/handlers/processBatch.ts:41 +#: src/webhook/handlers/processBatch.ts:58 msgid "No" msgstr "いいえ" @@ -117,7 +117,7 @@ msgstr "いいえ" msgid "None of these messages matches mine :(" msgstr "確認したい情報が見つかりません (T_T)" -#: src/webhook/handlers/utils.ts:99 +#: src/webhook/handlers/utils.ts:103 #, javascript-format msgid "${ positive } user considers this helpful" msgid_plural "${ positive } users consider this helpful" @@ -128,7 +128,7 @@ msgstr[0] "${positive} 人がこのリプライは役に立っていると思っ msgid "Tell us more" msgstr "情報を報告する" -#: src/webhook/handlers/askingCooccurrence.ts:190 +#: src/webhook/handlers/askingCooccurrence.ts:262 #: src/webhook/handlers/initState.ts:175 #: src/webhook/handlers/processMedia.ts:137 #. Get first few search results for each message, and make at most 10 options @@ -145,7 +145,7 @@ msgstr "以下から調べたいリプライを選んでください。" msgid "Someone thinks it ${ typeWords }" msgstr "誰かが次のように考えています ${typeWords}" -#: src/webhook/handlers/utils.ts:1023 +#: src/webhook/handlers/utils.ts:1105 #, javascript-format msgid "Looks ${ similarityPercentage }% similar" msgstr "${similarityPercentage}% 似ています" @@ -167,7 +167,7 @@ msgid "" "search sessions do not work now." msgstr "新規の情報を検索しているため、先ほどまでの検索ボタンは無効になります。" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:192 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:196 #, javascript-format msgid "Your submission is now recorded at ${ articleUrl }" msgstr "提供していただいた情報はこちらに登録されています ${ articleUrl }" @@ -208,8 +208,8 @@ msgid "Share to friends" msgstr "友達にシェアする" #: src/webhook/handlers/askingArticleSource.ts:34 -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:53 -#: src/webhook/handlers/askingCooccurrence.ts:39 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:54 +#: src/webhook/handlers/askingCooccurrence.ts:40 #: src/webhook/handlers/choosingArticle.ts:71 #: src/webhook/handlers/choosingReply.ts:152 msgid "Please choose from provided options." @@ -244,7 +244,7 @@ msgstr "「${displayTextWhenChosen}」を選ぶ" msgid "Provide more info" msgstr "更なる情報を提供する" -#: src/webhook/handlers/choosingReply.ts:184 +#: src/webhook/handlers/choosingReply.ts:188 msgid "" "We have problem retrieving message and reply data, please forward the " "message again" @@ -271,35 +271,29 @@ msgstr "データベースにいくつかの情報は、送ってくれた「${ msgid "Please proceed on your mobile phone." msgstr "スマホで操作を続けてください。" -#: src/webhook/handlers/askingCooccurrence.ts:125 -#: src/webhook/handlers/utils.ts:171 +#: src/webhook/handlers/utils.ts:159 msgid "Be the first to report the message" msgstr "この情報にリプライする最初の人になりましょう" -#: src/webhook/handlers/askingCooccurrence.ts:111 -#: src/webhook/handlers/utils.ts:159 -msgid "press “${ btnText }” to make this message public on Cofacts database " -msgstr "「${ btnText }」ボタンを押して Cofacts のデータベースで公開しましょう" - -#: src/webhook/handlers/utils.ts:268 +#: src/webhook/handlers/utils.ts:341 msgid "Share on LINE" msgstr "LINE で聞く" -#: src/webhook/handlers/utils.ts:270 +#: src/webhook/handlers/utils.ts:343 #, javascript-format msgid "Please help me verify if this is true: ${ articleUrl }" msgstr "これは本当かどうか見てもらえませんか:${ articleUrl }" -#: src/webhook/handlers/utils.ts:280 +#: src/webhook/handlers/utils.ts:353 msgid "Share on Facebook" msgstr "Facebook で聞く" -#: src/webhook/handlers/utils.ts:284 +#: src/webhook/handlers/utils.ts:357 #. t: Facebook hash tag msgid "ReportedToCofacts" msgstr "Cofacts に問い合せる" -#: src/webhook/handlers/utils.ts:382 +#: src/webhook/handlers/utils.ts:455 msgid "" "We suggest forwarding the message to the following fact-checkers instead. " "They have 💁 1-on-1 Q&A service to respond to your questions." @@ -473,11 +467,11 @@ msgstr "今のところ設定のオプションはありません :)" msgid "You can configure Cofacts here to meet your need." msgstr "ここでニーズに応じて Cofacts の設定ができます。" -#: src/webhook/handlers/utils.ts:333 +#: src/webhook/handlers/utils.ts:406 msgid "Go to settings" msgstr "設定する" -#: src/webhook/handlers/utils.ts:309 +#: src/webhook/handlers/utils.ts:382 msgid "Receive updates" msgstr "通知をオンにする" @@ -608,7 +602,7 @@ msgid "" "database." msgstr "検査結果は見当たらなかった場合、この情報をデータベースに入れるかどうかについてあなたの許可をお尋ねします。" -#: src/webhook/handlers/utils.ts:659 +#: src/webhook/handlers/utils.ts:734 msgid "" "This content is provided by Cofact message reporting chatbot and " "crowd-sourced fact-checking community under CC BY-SA 4.0 license. Please " @@ -644,8 +638,8 @@ msgid "You can try:" msgstr "" #: src/webhook/handlers/askingArticleSource.ts:77 -#: src/webhook/handlers/choosingArticle.ts:446 -#: src/webhook/handlers/utils.ts:695 +#: src/webhook/handlers/choosingArticle.ts:448 +#: src/webhook/handlers/utils.ts:770 msgid "Provide more detail" msgstr "" @@ -683,23 +677,23 @@ msgstr "" msgid "Do you want someone to fact-check this message?" msgstr "" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:79 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:80 msgid "The message has not been reported and won’t be fact-checked. Thanks anyway!" msgstr "" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:209 -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:219 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:213 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:223 msgid "" "The message has now been recorded at Cofacts for volunteers to fact-check. " "Thank you for submitting!" msgstr "" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:225 -#: src/webhook/handlers/choosingArticle.ts:434 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:229 +#: src/webhook/handlers/choosingArticle.ts:436 msgid "View reported message" msgstr "" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:237 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:241 #: src/webhook/handlers/choosingArticle.ts:378 msgid "In the meantime, you can:" msgstr "" @@ -724,8 +718,8 @@ msgstr "" msgid "Provided message is not found." msgstr "" -#: src/webhook/handlers/choosingArticle.ts:414 -#: src/webhook/handlers/choosingArticle.ts:427 +#: src/webhook/handlers/choosingArticle.ts:416 +#: src/webhook/handlers/choosingArticle.ts:429 msgid "" "This message has already published on Cofacts, and will soon be " "fact-checked by volunteers.\n" @@ -758,70 +752,64 @@ msgid "" "like to help." msgstr "" -#: src/webhook/handlers/askingCooccurrence.ts:103 -#: src/webhook/handlers/utils.ts:151 -msgid "Report to database" -msgstr "" - +#: src/webhook/handlers/askingCooccurrence.ts:96 #: src/webhook/handlers/utils.ts:155 -msgid "" -"Currently we don’t have this message in our database. If you think it is " -"most likely a rumor, " +msgid "Report to database" msgstr "" -#: src/webhook/handlers/askingCooccurrence.ts:117 -#: src/webhook/handlers/utils.ts:165 +#: src/webhook/handlers/askingCooccurrence.ts:204 +#: src/webhook/handlers/utils.ts:254 msgid "" "and have volunteers fact-check it. This way you can help the people who " "receive the same message in the future." msgstr "" -#: src/webhook/handlers/askingCooccurrence.ts:157 -#: src/webhook/handlers/askingCooccurrence.ts:159 -#: src/webhook/handlers/utils.ts:209 -#: src/webhook/handlers/utils.ts:211 +#: src/webhook/handlers/askingCooccurrence.ts:226 +#: src/webhook/handlers/askingCooccurrence.ts:228 +#: src/webhook/handlers/utils.ts:282 +#: src/webhook/handlers/utils.ts:284 msgid "Don’t report" msgstr "" -#: src/webhook/handlers/utils.ts:255 +#: src/webhook/handlers/utils.ts:328 msgid "" "We all get by with a little help from our friends 🌟 Share your question to " "friends, someone might be able to help!" msgstr "" -#: src/webhook/handlers/utils.ts:320 +#: src/webhook/handlers/utils.ts:393 msgid "" "You can turn on notifications if you want Cofacts to notify you when " "someone replies to this message." msgstr "" -#: src/webhook/handlers/utils.ts:634 +#: src/webhook/handlers/utils.ts:709 msgid "Thank you for sharing “${ inputSummary }”" msgstr "" -#: src/webhook/handlers/utils.ts:634 +#: src/webhook/handlers/utils.ts:709 msgid "I found that there are some disagreement to the message:" msgstr "" -#: src/webhook/handlers/utils.ts:708 +#: src/webhook/handlers/utils.ts:783 msgid "It would help fact checkers a lot if you provide more detail :)" msgstr "" -#: src/webhook/handlers/utils.ts:721 +#: src/webhook/handlers/utils.ts:796 msgid "Provide detail" msgstr "" -#: src/webhook/handlers/utils.ts:800 +#: src/webhook/handlers/utils.ts:875 msgid "Did you forward this message as a whole to me from the LINE app?" msgstr "" -#: src/webhook/handlers/utils.ts:826 -#: src/webhook/handlers/utils.ts:828 +#: src/webhook/handlers/utils.ts:901 +#: src/webhook/handlers/utils.ts:903 msgid "Yes, I forwarded it as a whole" msgstr "" -#: src/webhook/handlers/utils.ts:838 -#: src/webhook/handlers/utils.ts:840 +#: src/webhook/handlers/utils.ts:913 +#: src/webhook/handlers/utils.ts:915 msgid "No, typed it myself" msgstr "" @@ -1021,92 +1009,69 @@ msgstr "" msgid "Viewed on ${ dateString }" msgstr "" -#: src/lib/sharedUtils.js:70 +#: src/lib/sharedUtils.js:78 #, javascript-format msgid "${ dateStr } ago" msgstr "" -#: src/webhook/handlers/utils.ts:1025 +#: src/webhook/handlers/utils.ts:1107 msgid "Similar file" msgstr "" -#: src/webhook/handlers/utils.ts:1026 +#: src/webhook/handlers/utils.ts:1108 msgid "Contains relevant text" msgstr "" -#: src/webhook/handlers/utils.ts:1035 +#: src/webhook/handlers/utils.ts:1117 msgid "(Text in the hyperlink)" msgstr "" -#: src/webhook/handlers/utils.ts:1039 +#: src/webhook/handlers/utils.ts:1121 msgid "(Text in transcript)" msgstr "" -#: src/webhook/handlers/utils.ts:1115 +#: src/webhook/handlers/utils.ts:1197 #, javascript-format msgid "I choose ${ displayTextWhenChosen }" msgstr "" -#: src/webhook/handlers/askingCooccurrence.ts:181 +#: src/webhook/handlers/askingCooccurrence.ts:253 #. Get first few search results for each message, and make at most 10 options #. msgid "There are some messages that looks similar to the ones you have sent to me." msgstr "" -#: src/webhook/handlers/askingCooccurrence.ts:57 +#: src/webhook/handlers/askingCooccurrence.ts:58 msgid "Please send me the messages separately." msgstr "" -#: src/webhook/handlers/askingCooccurrence.ts:96 -#, javascript-format -msgid "" -"None of the ${ notInDbMsgIndexes.length } messages you sent are in the " -"Cofacts database." -msgstr "" - -#: src/webhook/handlers/askingCooccurrence.ts:97 -#, javascript-format -msgid "" -"Out of the ${ totalCount } messages you sent, ${ notInDbMsgIndexes.length } " -"is not in the Cofacts database." -msgid_plural "" -"Out of the ${ totalCount } messages you sent, ${ notInDbMsgIndexes.length } " -"are not in the Cofacts database." -msgstr[0] "" -msgstr[1] "" - -#: src/webhook/handlers/askingCooccurrence.ts:107 -#, javascript-format -msgid "${ inDbStatus } If you think they are most likely a rumor," -msgstr "" - -#: src/webhook/handlers/processBatch.ts:24 +#: src/webhook/handlers/processBatch.ts:41 #, javascript-format msgid "" "May I ask if the ${ msgCount } messages above were sent by the same person " "at the same time?" msgstr "" -#: src/webhook/handlers/processBatch.ts:33 +#: src/webhook/handlers/processBatch.ts:50 msgid "Yes, same person at same time" msgstr "" -#: src/webhook/handlers/processBatch.ts:43 +#: src/webhook/handlers/processBatch.ts:60 msgid "No, from different person or at different time" msgstr "" -#: src/webhook/handlers/utils.ts:137 +#: src/webhook/handlers/utils.ts:141 msgid "replied at" msgstr "" -#: src/webhook/handlers/utils.ts:567 +#: src/webhook/handlers/utils.ts:642 #, javascript-format msgid "" "Someone on the internet replies to the message first reported on ${ " "articleDate }:" msgstr "" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:242 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:246 msgid "" "This article is still under verification, please refrain from believing it " "for now. \n" @@ -1114,17 +1079,101 @@ msgid "" "with some insights." msgstr "" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:246 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:250 msgid "After reading the automatic analysis by the bot above, you can:" msgstr "" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:168 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:172 msgid "" "Thank you for submitting! Now the messages has been recorded in the Cofacts " "database." msgstr "" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:171 #: src/webhook/handlers/askingArticleSubmissionConsent.ts:175 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:179 msgid "Please choose the messages you would like to view" +msgstr "" + +#: src/webhook/handlers/askingCooccurrence.ts:102 +msgid "Be the first to report these messages" +msgstr "" + +#: src/webhook/handlers/askingCooccurrence.ts:116 +#, javascript-format +msgid "" +"The ${ notInDbMsgIndexes.length } messages that you have sent are not " +"within the Cofacts database." +msgstr "" + +#: src/webhook/handlers/askingCooccurrence.ts:117 +#, javascript-format +msgid "" +"Out of the ${ totalCount } messages you sent, ${ notInDbMsgIndexes.length } " +"is not within the Cofacts database." +msgid_plural "" +"Out of the ${ totalCount } messages you sent, ${ notInDbMsgIndexes.length } " +"are not within the Cofacts database." +msgstr[0] "" + +#: src/webhook/handlers/askingCooccurrence.ts:126 +#: src/webhook/handlers/utils.ts:176 +msgid "If you believe:" +msgstr "" + +#: src/webhook/handlers/askingCooccurrence.ts:146 +#. t: If you believe ~ a rumor +msgid "That they are most likely " +msgstr "" + +#: src/webhook/handlers/askingCooccurrence.ts:150 +#. t: If you believe that it is most likely ~ +msgid "rumors," +msgstr "" + +#: src/webhook/handlers/askingCooccurrence.ts:178 +#: src/webhook/handlers/utils.ts:228 +#. t: ~ make this messasge public +msgid "And you are willing to " +msgstr "" + +#: src/webhook/handlers/askingCooccurrence.ts:182 +#. t: and you are willing to ~ +msgid "make these messages public" +msgstr "" + +#: src/webhook/handlers/askingCooccurrence.ts:198 +#, javascript-format +msgid "Press “${ btnText }” to make these messages public on Cofacts website " +msgstr "" + +#: src/webhook/handlers/utils.ts:171 +msgid "We currently don’t have this message in our database." +msgstr "" + +#: src/webhook/handlers/utils.ts:196 +#. t: If you believe ~ a rumor +msgid "That it is most likely " +msgstr "" + +#: src/webhook/handlers/utils.ts:200 +#. t: If you believe that it is most likely ~ +msgid "a rumor," +msgstr "" + +#: src/webhook/handlers/utils.ts:232 +#. t: and you are willing to ~ +msgid "make this message public" +msgstr "" + +#: src/webhook/handlers/utils.ts:248 +#, javascript-format +msgid "Press “${ btnText }” to make this message public on Cofacts website " +msgstr "" + +#: src/lib/sharedUtils.js:59 +msgid "unknown date" +msgstr "" + +#: src/lib/sharedUtils.js:67 +msgid "unknown time" msgstr "" \ No newline at end of file diff --git a/i18n/zh_TW.po b/i18n/zh_TW.po index 3e6c9992..11ab5785 100644 --- a/i18n/zh_TW.po +++ b/i18n/zh_TW.po @@ -6,40 +6,40 @@ msgstr "" "mime-version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" -#: src/webhook/handlers/utils.ts:94 +#: src/webhook/handlers/utils.ts:98 msgid "No feedback yet" msgstr "還沒有人針對此回應評價" -#: src/webhook/handlers/utils.ts:108 +#: src/webhook/handlers/utils.ts:112 msgid "${ negative } user consider this not useful" msgid_plural "${ negative } users consider this not useful" msgstr[0] "有 ${negative} 人覺得此回應沒幫助" -#: src/lib/sharedUtils.js:79 +#: src/lib/sharedUtils.js:87 msgid "Contains misinformation" msgstr "含有不實訊息" -#: src/lib/sharedUtils.js:81 +#: src/lib/sharedUtils.js:89 msgid "Contains true information" msgstr "含有真實訊息" -#: src/lib/sharedUtils.js:83 +#: src/lib/sharedUtils.js:91 msgid "Contains personal perspective" msgstr "含有個人意見" -#: src/lib/sharedUtils.js:85 +#: src/lib/sharedUtils.js:93 msgid "Invalid request" msgstr "不在查證範圍" -#: src/webhook/handlers/utils.ts:135 +#: src/webhook/handlers/utils.ts:139 msgid "different opinions" msgstr "不同觀點" -#: src/webhook/handlers/utils.ts:135 +#: src/webhook/handlers/utils.ts:139 msgid "references" msgstr "出處" -#: src/webhook/handlers/utils.ts:141 +#: src/webhook/handlers/utils.ts:145 #, javascript-format msgid "This reply has no ${ prompt } and it may be biased" msgstr "此回應沒有${prompt},請自行斟酌回應之可信度。" @@ -61,11 +61,11 @@ msgstr "看他怎麼說" msgid "Visit ${ articleUrl } for more replies." msgstr "更多回應請到:${ articleUrl }" -#: src/webhook/handlers/utils.ts:1113 +#: src/webhook/handlers/utils.ts:1195 msgid "Choose this one" msgstr "選擇這篇" -#: src/webhook/handlers/askingCooccurrence.ts:185 +#: src/webhook/handlers/askingCooccurrence.ts:257 #: src/webhook/handlers/initState.ts:188 #: src/webhook/handlers/processMedia.ts:150 #. Get first few search results for each message, and make at most 10 options @@ -77,36 +77,36 @@ msgstr "" "不實訊息常常會被人修改重發。\n" "請選擇比較接近的版本" -#: src/webhook/handlers/utils.ts:658 +#: src/webhook/handlers/utils.ts:733 #, javascript-format msgid "Therefore, the author think the message ${ typeStr }." msgstr "綜合以上,回應者認為它${typeStr}。" -#: src/webhook/handlers/utils.ts:661 +#: src/webhook/handlers/utils.ts:736 msgid "" "There are different replies for the message. Read them all here before " "making judgements:" msgstr "這則訊息有很多不同回應,建議到這裡一次讀完再下判斷:" -#: src/webhook/handlers/utils.ts:663 +#: src/webhook/handlers/utils.ts:738 msgid "If you have different thoughts, you may have your say here:" msgstr "如果你對這則訊息有不同看法,歡迎到下面這裡寫入新的回應:" #: src/liff/components/FeedbackForm.svelte:23 #: src/webhook/handlers/choosingReply.ts:48 -#: src/webhook/handlers/choosingReply.ts:197 +#: src/webhook/handlers/choosingReply.ts:213 msgid "Is the reply helpful?" msgstr "請問上面回應是否有幫助?" #: src/liff/components/FeedbackForm.svelte:27 #: src/webhook/handlers/choosingReply.ts:63 -#: src/webhook/handlers/processBatch.ts:31 +#: src/webhook/handlers/processBatch.ts:48 msgid "Yes" msgstr "是" #: src/liff/components/FeedbackForm.svelte:30 #: src/webhook/handlers/choosingReply.ts:73 -#: src/webhook/handlers/processBatch.ts:41 +#: src/webhook/handlers/processBatch.ts:58 msgid "No" msgstr "否" @@ -117,7 +117,7 @@ msgstr "否" msgid "None of these messages matches mine :(" msgstr "找不到我想查的訊息 QQ" -#: src/webhook/handlers/utils.ts:99 +#: src/webhook/handlers/utils.ts:103 #, javascript-format msgid "${ positive } user considers this helpful" msgid_plural "${ positive } users consider this helpful" @@ -128,7 +128,7 @@ msgstr[0] "有 ${positive} 人覺得此回應有幫助" msgid "Tell us more" msgstr "回報此訊息" -#: src/webhook/handlers/askingCooccurrence.ts:190 +#: src/webhook/handlers/askingCooccurrence.ts:262 #: src/webhook/handlers/initState.ts:175 #: src/webhook/handlers/processMedia.ts:137 #. Get first few search results for each message, and make at most 10 options @@ -145,7 +145,7 @@ msgstr "請從下列選擇您要查看的回應。" msgid "Someone thinks it ${ typeWords }" msgstr "有人認為它${typeWords}" -#: src/webhook/handlers/utils.ts:1023 +#: src/webhook/handlers/utils.ts:1105 #, javascript-format msgid "Looks ${ similarityPercentage }% similar" msgstr "看起來 ${similarityPercentage}% 像" @@ -167,7 +167,7 @@ msgid "" "search sessions do not work now." msgstr "您已經在搜尋新的訊息了,過去查過的訊息的按鈕已經失效囉。" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:192 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:196 #, javascript-format msgid "Your submission is now recorded at ${ articleUrl }" msgstr "您回報的訊息已經被收錄至 ${ articleUrl }" @@ -208,8 +208,8 @@ msgid "Share to friends" msgstr "分享給朋友" #: src/webhook/handlers/askingArticleSource.ts:34 -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:53 -#: src/webhook/handlers/askingCooccurrence.ts:39 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:54 +#: src/webhook/handlers/askingCooccurrence.ts:40 #: src/webhook/handlers/choosingArticle.ts:71 #: src/webhook/handlers/choosingReply.ts:152 msgid "Please choose from provided options." @@ -244,7 +244,7 @@ msgstr "我要選「${displayTextWhenChosen}」" msgid "Provide more info" msgstr "提供更多資訊" -#: src/webhook/handlers/choosingReply.ts:184 +#: src/webhook/handlers/choosingReply.ts:188 msgid "" "We have problem retrieving message and reply data, please forward the " "message again" @@ -271,35 +271,29 @@ msgstr "資料庫裡有幾篇訊息,跟您傳給我的「${ inputSummary }」 msgid "Please proceed on your mobile phone." msgstr "請在您的手機上繼續操作。" -#: src/webhook/handlers/askingCooccurrence.ts:125 -#: src/webhook/handlers/utils.ts:171 +#: src/webhook/handlers/utils.ts:159 msgid "Be the first to report the message" msgstr "成為全球首位回報此訊息的人" -#: src/webhook/handlers/askingCooccurrence.ts:111 -#: src/webhook/handlers/utils.ts:159 -msgid "press “${ btnText }” to make this message public on Cofacts database " -msgstr "請按「${ btnText }」在 Cofacts 真的假的資料庫公開這則訊息" - -#: src/webhook/handlers/utils.ts:268 +#: src/webhook/handlers/utils.ts:341 msgid "Share on LINE" msgstr "在 LINE 上問人" -#: src/webhook/handlers/utils.ts:270 +#: src/webhook/handlers/utils.ts:343 #, javascript-format msgid "Please help me verify if this is true: ${ articleUrl }" msgstr "請幫我看看這是真的還是假的:${ articleUrl }" -#: src/webhook/handlers/utils.ts:280 +#: src/webhook/handlers/utils.ts:353 msgid "Share on Facebook" msgstr "請教臉書大神" -#: src/webhook/handlers/utils.ts:284 +#: src/webhook/handlers/utils.ts:357 #. t: Facebook hash tag msgid "ReportedToCofacts" msgstr "Cofacts求解惑" -#: src/webhook/handlers/utils.ts:382 +#: src/webhook/handlers/utils.ts:455 msgid "" "We suggest forwarding the message to the following fact-checkers instead. " "They have 💁 1-on-1 Q&A service to respond to your questions." @@ -471,11 +465,11 @@ msgstr "目前沒有設定選項 :)" msgid "You can configure Cofacts here to meet your need." msgstr "您可以在這裡設定 Cofacts 以符合需求。" -#: src/webhook/handlers/utils.ts:333 +#: src/webhook/handlers/utils.ts:406 msgid "Go to settings" msgstr "前往設定" -#: src/webhook/handlers/utils.ts:309 +#: src/webhook/handlers/utils.ts:382 msgid "Receive updates" msgstr "開啟小鈴鐺" @@ -606,7 +600,7 @@ msgid "" "database." msgstr "如果我找不到的話,會徵求你的同意,看看要不要把這個訊息送進資料庫唷。" -#: src/webhook/handlers/utils.ts:659 +#: src/webhook/handlers/utils.ts:734 msgid "" "This content is provided by Cofact message reporting chatbot and " "crowd-sourced fact-checking community under CC BY-SA 4.0 license. Please " @@ -615,7 +609,7 @@ msgstr "" "此內容由「Cofacts 真的假的」訊息回報機器人與查核協作社群提供,以創用 CC 姓名標示-相同方式分享 4.0 國際 " "授權條款釋出。請斟酌出處與理由,自行思考判斷。" -#: src/webhook/handlers/utils.ts:634 +#: src/webhook/handlers/utils.ts:709 msgid "I found that there are some disagreement to the message:" msgstr "剛剛這則訊息,我查過似乎發現有點問題。有另外一種說法是:" @@ -623,7 +617,7 @@ msgstr "剛剛這則訊息,我查過似乎發現有點問題。有另外一種 msgid "Hi i am cofacts chat bot" msgstr "Hi 我是「Cofacts 真的假的」訊息查證機器人~" -#: src/webhook/handlers/utils.ts:634 +#: src/webhook/handlers/utils.ts:709 msgid "Thank you for sharing “${ inputSummary }”" msgstr "感謝您的分享 “${ inputSummary }”" @@ -676,7 +670,7 @@ msgstr "這個回應不太有幫助,我建議⋯⋯" msgid "Viewed on ${ dateString }" msgstr "在${ dateString }看過" -#: src/lib/sharedUtils.js:70 +#: src/lib/sharedUtils.js:78 #, javascript-format msgid "${ dateStr } ago" msgstr "${ dateStr }前" @@ -816,27 +810,27 @@ msgstr "此訊息不存在。" msgid "The reply does not exist. Maybe it has been deleted by its author." msgstr "此回應不存在。或許已經被作者刪掉囉。" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:225 -#: src/webhook/handlers/choosingArticle.ts:434 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:229 +#: src/webhook/handlers/choosingArticle.ts:436 msgid "View reported message" msgstr "檢視回報訊息" #: src/webhook/handlers/askingArticleSource.ts:77 -#: src/webhook/handlers/choosingArticle.ts:446 -#: src/webhook/handlers/utils.ts:695 +#: src/webhook/handlers/choosingArticle.ts:448 +#: src/webhook/handlers/utils.ts:770 msgid "Provide more detail" msgstr "提供更多情報" -#: src/webhook/handlers/utils.ts:708 +#: src/webhook/handlers/utils.ts:783 msgid "It would help fact checkers a lot if you provide more detail :)" msgstr "您可以提供更多關於此訊息的情報給查證志工,讓好心人更容易查真假唷!" -#: src/webhook/handlers/utils.ts:721 +#: src/webhook/handlers/utils.ts:796 msgid "Provide detail" msgstr "提供更多情報" -#: src/webhook/handlers/choosingArticle.ts:414 -#: src/webhook/handlers/choosingArticle.ts:427 +#: src/webhook/handlers/choosingArticle.ts:416 +#: src/webhook/handlers/choosingArticle.ts:429 msgid "" "This message has already published on Cofacts, and will soon be " "fact-checked by volunteers.\n" @@ -845,18 +839,18 @@ msgstr "" "此訊息已經被收錄至 Cofacts 有待好心人來查證。\n" "請先不要相信這個訊息唷!" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:237 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:241 #: src/webhook/handlers/choosingArticle.ts:378 msgid "In the meantime, you can:" msgstr "接下來您可以:" -#: src/webhook/handlers/utils.ts:255 +#: src/webhook/handlers/utils.ts:328 msgid "" "We all get by with a little help from our friends 🌟 Share your question to " "friends, someone might be able to help!" msgstr "遠親不如近鄰🌟問問親友總沒錯。把訊息分享給朋友們,說不定有人能幫你解惑!" -#: src/webhook/handlers/utils.ts:320 +#: src/webhook/handlers/utils.ts:393 msgid "" "You can turn on notifications if you want Cofacts to notify you when " "someone replies to this message." @@ -921,12 +915,12 @@ msgstr "這樣呀。請先不要相信這個訊息唷!" msgid "Do you want someone to fact-check this message?" msgstr "你要請人查查這則訊息嗎?" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:79 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:80 msgid "The message has not been reported and won’t be fact-checked. Thanks anyway!" msgstr "好的,那就不查囉。還是謝謝你!" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:209 -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:219 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:213 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:223 msgid "" "The message has now been recorded at Cofacts for volunteers to fact-check. " "Thank you for submitting!" @@ -946,42 +940,36 @@ msgid "" "still like to help." msgstr "抱歉我目前還不認得「${ inputSummary }」這個訊息,可是我還是想幫你查證。" -#: src/webhook/handlers/askingCooccurrence.ts:103 -#: src/webhook/handlers/utils.ts:151 +#: src/webhook/handlers/askingCooccurrence.ts:96 +#: src/webhook/handlers/utils.ts:155 msgid "Report to database" msgstr "送進資料庫查核" -#: src/webhook/handlers/utils.ts:155 -msgid "" -"Currently we don’t have this message in our database. If you think it is " -"most likely a rumor, " -msgstr "目前資料庫裡沒有您傳的訊息。若您覺得它很可能是一則謠言," - -#: src/webhook/handlers/askingCooccurrence.ts:117 -#: src/webhook/handlers/utils.ts:165 +#: src/webhook/handlers/askingCooccurrence.ts:204 +#: src/webhook/handlers/utils.ts:254 msgid "" "and have volunteers fact-check it. This way you can help the people who " "receive the same message in the future." msgstr "、讓好心人查證與回覆。您可以幫助到未來同樣收到這份訊息的人。" -#: src/webhook/handlers/askingCooccurrence.ts:157 -#: src/webhook/handlers/askingCooccurrence.ts:159 -#: src/webhook/handlers/utils.ts:209 -#: src/webhook/handlers/utils.ts:211 +#: src/webhook/handlers/askingCooccurrence.ts:226 +#: src/webhook/handlers/askingCooccurrence.ts:228 +#: src/webhook/handlers/utils.ts:282 +#: src/webhook/handlers/utils.ts:284 msgid "Don’t report" msgstr "我不想回報訊息" -#: src/webhook/handlers/utils.ts:800 +#: src/webhook/handlers/utils.ts:875 msgid "Did you forward this message as a whole to me from the LINE app?" msgstr "請問這個訊息是你從 LINE 裡整篇分享給我的嗎?" -#: src/webhook/handlers/utils.ts:826 -#: src/webhook/handlers/utils.ts:828 +#: src/webhook/handlers/utils.ts:901 +#: src/webhook/handlers/utils.ts:903 msgid "Yes, I forwarded it as a whole" msgstr "是,我整篇分享過來的" -#: src/webhook/handlers/utils.ts:838 -#: src/webhook/handlers/utils.ts:840 +#: src/webhook/handlers/utils.ts:913 +#: src/webhook/handlers/utils.ts:915 msgid "No, typed it myself" msgstr "否,我自行打字輸入的" @@ -1026,86 +1014,64 @@ msgstr "尚未支援預覽" msgid "An audio" msgstr "語音訊息一則" -#: src/webhook/handlers/utils.ts:1025 +#: src/webhook/handlers/utils.ts:1107 msgid "Similar file" msgstr "相似檔案" -#: src/webhook/handlers/utils.ts:1026 +#: src/webhook/handlers/utils.ts:1108 msgid "Contains relevant text" msgstr "含有相關文字" -#: src/webhook/handlers/utils.ts:1035 +#: src/webhook/handlers/utils.ts:1117 msgid "(Text in the hyperlink)" msgstr "網址內的字" -#: src/webhook/handlers/utils.ts:1039 +#: src/webhook/handlers/utils.ts:1121 msgid "(Text in transcript)" msgstr "逐字稿內的字" -#: src/webhook/handlers/utils.ts:1115 +#: src/webhook/handlers/utils.ts:1197 #, javascript-format msgid "I choose ${ displayTextWhenChosen }" msgstr "我選 ${ displayTextWhenChosen }" -#: src/webhook/handlers/askingCooccurrence.ts:181 +#: src/webhook/handlers/askingCooccurrence.ts:253 #. Get first few search results for each message, and make at most 10 options #. msgid "There are some messages that looks similar to the ones you have sent to me." msgstr "資料庫裡有幾篇訊息,跟您傳給我的有些接近。" -#: src/webhook/handlers/askingCooccurrence.ts:57 +#: src/webhook/handlers/askingCooccurrence.ts:58 msgid "Please send me the messages separately." msgstr "好的,那再請您將這些訊息一則一則分開傳給我唷。" -#: src/webhook/handlers/askingCooccurrence.ts:96 -#, javascript-format -msgid "" -"None of the ${ notInDbMsgIndexes.length } messages you sent are in the " -"Cofacts database." -msgstr "您傳的 ${ notInDbMsgIndexes.length } 則訊息,目前都不在 Cofacts 資料庫裡。" - -#: src/webhook/handlers/askingCooccurrence.ts:97 -#, javascript-format -msgid "" -"Out of the ${ totalCount } messages you sent, ${ notInDbMsgIndexes.length } " -"is not in the Cofacts database." -msgid_plural "" -"Out of the ${ totalCount } messages you sent, ${ notInDbMsgIndexes.length } " -"are not in the Cofacts database." -msgstr[0] "在您傳的 ${ totalCount } 則訊息中,有 ${ notInDbMsgIndexes.length } 則不在 Cofacts 資料庫裡。" - -#: src/webhook/handlers/askingCooccurrence.ts:107 -#, javascript-format -msgid "${ inDbStatus } If you think they are most likely a rumor," -msgstr "${ inDbStatus }若您覺得它們很可能是謠言," - -#: src/webhook/handlers/processBatch.ts:24 +#: src/webhook/handlers/processBatch.ts:41 #, javascript-format msgid "" "May I ask if the ${ msgCount } messages above were sent by the same person " "at the same time?" msgstr "請問這 ${ msgCount } 則訊息,是由同一個人、同時傳送的嗎?" -#: src/webhook/handlers/processBatch.ts:33 +#: src/webhook/handlers/processBatch.ts:50 msgid "Yes, same person at same time" msgstr "是同一人、同時傳送的" -#: src/webhook/handlers/processBatch.ts:43 +#: src/webhook/handlers/processBatch.ts:60 msgid "No, from different person or at different time" msgstr "是由不同人、或不同時間傳的" -#: src/webhook/handlers/utils.ts:137 +#: src/webhook/handlers/utils.ts:141 msgid "replied at" msgstr "回應日期" -#: src/webhook/handlers/utils.ts:567 +#: src/webhook/handlers/utils.ts:642 #, javascript-format msgid "" "Someone on the internet replies to the message first reported on ${ " "articleDate }:" msgstr "網路上有人這樣回應這則 ${articleDate} 回報的訊息:" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:242 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:246 msgid "" "This article is still under verification, please refrain from believing it " "for now. \n" @@ -1115,17 +1081,101 @@ msgstr "" "這篇文章尚待查核中,請先不要相信這篇文章。\n" "以下是機器人初步分析此篇訊息的結果,希望能帶給你一些想法。" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:246 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:250 msgid "After reading the automatic analysis by the bot above, you can:" msgstr "讀完以上機器人的自動分析後,您可以:" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:168 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:172 msgid "" "Thank you for submitting! Now the messages has been recorded in the Cofacts " "database." msgstr "感謝提供!現在資料庫裡有這些訊息囉。" -#: src/webhook/handlers/askingArticleSubmissionConsent.ts:171 #: src/webhook/handlers/askingArticleSubmissionConsent.ts:175 +#: src/webhook/handlers/askingArticleSubmissionConsent.ts:179 msgid "Please choose the messages you would like to view" -msgstr "請選擇要查看的訊息" \ No newline at end of file +msgstr "請選擇要查看的訊息" + +#: src/webhook/handlers/askingCooccurrence.ts:102 +msgid "Be the first to report these messages" +msgstr "成為全球首位回報這些訊息的人" + +#: src/webhook/handlers/askingCooccurrence.ts:116 +#, javascript-format +msgid "" +"The ${ notInDbMsgIndexes.length } messages that you have sent are not " +"within the Cofacts database." +msgstr "您傳的 ${ notInDbMsgIndexes.length } 則訊息,目前都不在 Cofacts 資料庫裡。" + +#: src/webhook/handlers/askingCooccurrence.ts:117 +#, javascript-format +msgid "" +"Out of the ${ totalCount } messages you sent, ${ notInDbMsgIndexes.length } " +"is not within the Cofacts database." +msgid_plural "" +"Out of the ${ totalCount } messages you sent, ${ notInDbMsgIndexes.length } " +"are not within the Cofacts database." +msgstr[0] "在您傳的 ${ totalCount } 則訊息中,有 ${ notInDbMsgIndexes.length } 則不在 Cofacts 資料庫裡。" + +#: src/webhook/handlers/askingCooccurrence.ts:126 +#: src/webhook/handlers/utils.ts:176 +msgid "If you believe:" +msgstr "若您覺得:" + +#: src/webhook/handlers/askingCooccurrence.ts:146 +#. t: If you believe ~ a rumor +msgid "That they are most likely " +msgstr "它們很可能是" + +#: src/webhook/handlers/askingCooccurrence.ts:150 +#. t: If you believe that it is most likely ~ +msgid "rumors," +msgstr "謠言" + +#: src/webhook/handlers/askingCooccurrence.ts:178 +#: src/webhook/handlers/utils.ts:228 +#. t: ~ make this messasge public +msgid "And you are willing to " +msgstr "您願意" + +#: src/webhook/handlers/askingCooccurrence.ts:182 +#. t: and you are willing to ~ +msgid "make these messages public" +msgstr "公開這些訊息" + +#: src/webhook/handlers/askingCooccurrence.ts:198 +#, javascript-format +msgid "Press “${ btnText }” to make these messages public on Cofacts website " +msgstr "請按「${ btnText }」在 Cofacts 網站公開它們" + +#: src/webhook/handlers/utils.ts:171 +msgid "We currently don’t have this message in our database." +msgstr "目前資料庫裡沒有您傳的訊息。" + +#: src/webhook/handlers/utils.ts:196 +#. t: If you believe ~ a rumor +msgid "That it is most likely " +msgstr "它很可能是" + +#: src/webhook/handlers/utils.ts:200 +#. t: If you believe that it is most likely ~ +msgid "a rumor," +msgstr "謠言" + +#: src/webhook/handlers/utils.ts:232 +#. t: and you are willing to ~ +msgid "make this message public" +msgstr "公開這則訊息" + +#: src/webhook/handlers/utils.ts:248 +#, javascript-format +msgid "Press “${ btnText }” to make this message public on Cofacts website " +msgstr "請按「${ btnText }」在 Cofacts 網站公開它" + +#: src/lib/sharedUtils.js:59 +msgid "unknown date" +msgstr "未知日期" + +#: src/lib/sharedUtils.js:67 +msgid "unknown time" +msgstr "未知時間" \ No newline at end of file diff --git a/src/webhook/handlers/__tests__/__snapshots__/choosingArticle.test.ts.snap b/src/webhook/handlers/__tests__/__snapshots__/choosingArticle.test.ts.snap index 629a3d95..eec448c3 100644 --- a/src/webhook/handlers/__tests__/__snapshots__/choosingArticle.test.ts.snap +++ b/src/webhook/handlers/__tests__/__snapshots__/choosingArticle.test.ts.snap @@ -126,15 +126,85 @@ Do you want someone to fact-check this message?", "contents": Object { "body": Object { "contents": Array [ + Object { + "text": "We currently don’t have this message in our database.", + "type": "text", + "wrap": true, + }, + Object { + "text": "If you believe:", + "type": "text", + "wrap": true, + }, Object { "contents": Array [ Object { - "text": "Currently we don’t have this message in our database. If you think it is most likely a rumor, ", - "type": "span", + "flex": 0, + "margin": "none", + "text": "🤔", + "type": "text", + }, + Object { + "contents": Array [ + Object { + "text": "That it is most likely ", + "type": "span", + }, + Object { + "color": "#ffb600", + "decoration": "none", + "text": "a rumor,", + "type": "span", + "weight": "bold", + }, + ], + "flex": 1, + "margin": "md", + "type": "text", + "wrap": true, }, + ], + "layout": "horizontal", + "margin": "md", + "type": "box", + }, + Object { + "contents": Array [ + Object { + "flex": 0, + "margin": "none", + "text": "🌐", + "type": "text", + }, + Object { + "contents": Array [ + Object { + "text": "And you are willing to ", + "type": "span", + }, + Object { + "color": "#ffb600", + "decoration": "none", + "text": "make this message public", + "type": "span", + "weight": "bold", + }, + ], + "flex": 1, + "margin": "md", + "type": "text", + "wrap": true, + }, + ], + "layout": "horizontal", + "margin": "md", + "type": "box", + }, + Object { + "contents": Array [ Object { "color": "#ffb600", - "text": "press “🆕 Report to database” to make this message public on Cofacts database ", + "text": "Press “🆕 Report to database” to make this message public on Cofacts website ", "type": "span", "weight": "bold", }, diff --git a/src/webhook/handlers/__tests__/__snapshots__/processMedia.test.js.snap b/src/webhook/handlers/__tests__/__snapshots__/processMedia.test.js.snap index a4e0a898..b280d4a3 100644 --- a/src/webhook/handlers/__tests__/__snapshots__/processMedia.test.js.snap +++ b/src/webhook/handlers/__tests__/__snapshots__/processMedia.test.js.snap @@ -561,15 +561,85 @@ Do you want someone to fact-check this message?", "contents": Object { "body": Object { "contents": Array [ + Object { + "text": "We currently don’t have this message in our database.", + "type": "text", + "wrap": true, + }, + Object { + "text": "If you believe:", + "type": "text", + "wrap": true, + }, Object { "contents": Array [ Object { - "text": "Currently we don’t have this message in our database. If you think it is most likely a rumor, ", - "type": "span", + "flex": 0, + "margin": "none", + "text": "🤔", + "type": "text", + }, + Object { + "contents": Array [ + Object { + "text": "That it is most likely ", + "type": "span", + }, + Object { + "color": "#ffb600", + "decoration": "none", + "text": "a rumor,", + "type": "span", + "weight": "bold", + }, + ], + "flex": 1, + "margin": "md", + "type": "text", + "wrap": true, }, + ], + "layout": "horizontal", + "margin": "md", + "type": "box", + }, + Object { + "contents": Array [ + Object { + "flex": 0, + "margin": "none", + "text": "🌐", + "type": "text", + }, + Object { + "contents": Array [ + Object { + "text": "And you are willing to ", + "type": "span", + }, + Object { + "color": "#ffb600", + "decoration": "none", + "text": "make this message public", + "type": "span", + "weight": "bold", + }, + ], + "flex": 1, + "margin": "md", + "type": "text", + "wrap": true, + }, + ], + "layout": "horizontal", + "margin": "md", + "type": "box", + }, + Object { + "contents": Array [ Object { "color": "#ffb600", - "text": "press “🆕 Report to database” to make this message public on Cofacts database ", + "text": "Press “🆕 Report to database” to make this message public on Cofacts website ", "type": "span", "weight": "bold", }, diff --git a/src/webhook/handlers/__tests__/askingArticleSource.test.ts b/src/webhook/handlers/__tests__/askingArticleSource.test.ts index 7000acc3..7136ea4f 100644 --- a/src/webhook/handlers/__tests__/askingArticleSource.test.ts +++ b/src/webhook/handlers/__tests__/askingArticleSource.test.ts @@ -265,15 +265,85 @@ it('sends user submission consent if user forwarded the whole message', async () "contents": Object { "body": Object { "contents": Array [ + Object { + "text": "We currently don’t have this message in our database.", + "type": "text", + "wrap": true, + }, + Object { + "text": "If you believe:", + "type": "text", + "wrap": true, + }, Object { "contents": Array [ Object { - "text": "Currently we don’t have this message in our database. If you think it is most likely a rumor, ", - "type": "span", + "flex": 0, + "margin": "none", + "text": "🤔", + "type": "text", + }, + Object { + "contents": Array [ + Object { + "text": "That it is most likely ", + "type": "span", + }, + Object { + "color": "#ffb600", + "decoration": "none", + "text": "a rumor,", + "type": "span", + "weight": "bold", + }, + ], + "flex": 1, + "margin": "md", + "type": "text", + "wrap": true, }, + ], + "layout": "horizontal", + "margin": "md", + "type": "box", + }, + Object { + "contents": Array [ + Object { + "flex": 0, + "margin": "none", + "text": "🌐", + "type": "text", + }, + Object { + "contents": Array [ + Object { + "text": "And you are willing to ", + "type": "span", + }, + Object { + "color": "#ffb600", + "decoration": "none", + "text": "make this message public", + "type": "span", + "weight": "bold", + }, + ], + "flex": 1, + "margin": "md", + "type": "text", + "wrap": true, + }, + ], + "layout": "horizontal", + "margin": "md", + "type": "box", + }, + Object { + "contents": Array [ Object { "color": "#ffb600", - "text": "press “🆕 Report to database” to make this message public on Cofacts database ", + "text": "Press “🆕 Report to database” to make this message public on Cofacts website ", "type": "span", "weight": "bold", }, diff --git a/src/webhook/handlers/askingCooccurrence.ts b/src/webhook/handlers/askingCooccurrence.ts index 76f84eee..3387f8dd 100644 --- a/src/webhook/handlers/askingCooccurrence.ts +++ b/src/webhook/handlers/askingCooccurrence.ts @@ -92,38 +92,14 @@ const askingCooccurence: ChatbotPostbackHandler = async ({ if (notInDbMsgIndexes.length > 0) { // Ask if the user want to submit those are not in DB into the database const totalCount = context.msgs.length; - const inDbStatus = - notInDbMsgIndexes.length === totalCount - ? t`None of the ${notInDbMsgIndexes.length} messages you sent are in the Cofacts database.` - : ngettext( - msgid`Out of the ${totalCount} messages you sent, ${notInDbMsgIndexes.length} is not in the Cofacts database.`, - `Out of the ${totalCount} messages you sent, ${notInDbMsgIndexes.length} are not in the Cofacts database.`, - notInDbMsgIndexes.length - ); const btnText = `🆕 ${t`Report to database`}`; - const spans: FlexSpan[] = [ - { - type: 'span', - text: t`${inDbStatus} If you think they are most likely a rumor,`, - }, - { - type: 'span', - text: t`press “${btnText}” to make this message public on Cofacts database `, - color: '#ffb600', - weight: 'bold', - }, - { - type: 'span', - text: t`and have volunteers fact-check it. This way you can help the people who receive the same message in the future.`, - }, - ]; return { context, replies: [ { type: 'flex', - altText: t`Be the first to report the message`, + altText: t`Be the first to report these messages`, contents: { type: 'bubble', body: { @@ -135,7 +111,99 @@ const askingCooccurence: ChatbotPostbackHandler = async ({ { type: 'text', wrap: true, - contents: spans, + text: + notInDbMsgIndexes.length === totalCount + ? t`The ${notInDbMsgIndexes.length} messages that you have sent are not within the Cofacts database.` + : ngettext( + msgid`Out of the ${totalCount} messages you sent, ${notInDbMsgIndexes.length} is not within the Cofacts database.`, + `Out of the ${totalCount} messages you sent, ${notInDbMsgIndexes.length} are not within the Cofacts database.`, + notInDbMsgIndexes.length + ), + }, + { + type: 'text', + wrap: true, + text: t`If you believe:`, + }, + { + type: 'box', + layout: 'horizontal', + contents: [ + { + type: 'text', + text: '🤔', + flex: 0, + margin: 'none', + }, + { + type: 'text', + wrap: true, + flex: 1, + margin: 'md', + contents: [ + { + type: 'span', + text: /* t: If you believe ~ a rumor */ t`That they are most likely `, + }, + { + type: 'span', + text: /* t: If you believe that it is most likely ~ */ t`rumors,`, + decoration: 'none', + color: '#ffb600', + weight: 'bold', + }, + ], + }, + ], + margin: 'md', + }, + { + type: 'box', + layout: 'horizontal', + contents: [ + { + type: 'text', + text: '🌐', + flex: 0, + margin: 'none', + }, + { + type: 'text', + wrap: true, + flex: 1, + margin: 'md', + contents: [ + { + type: 'span', + text: /* t: ~ make this messasge public */ t`And you are willing to `, + }, + { + type: 'span', + text: /* t: and you are willing to ~ */ t`make these messages public`, + decoration: 'none', + color: '#ffb600', + weight: 'bold', + }, + ], + }, + ], + margin: 'md', + }, + { + type: 'text', + wrap: true, + contents: [ + { + type: 'span', + text: t`Press “${btnText}” to make these messages public on Cofacts website `, + color: '#ffb600', + weight: 'bold', + }, + { + type: 'span', + text: t`and have volunteers fact-check it. This way you can help the people who receive the same message in the future.`, + }, + ], }, ], }, diff --git a/src/webhook/handlers/utils.ts b/src/webhook/handlers/utils.ts index ac53f539..fc40b5d9 100644 --- a/src/webhook/handlers/utils.ts +++ b/src/webhook/handlers/utils.ts @@ -153,22 +153,6 @@ export function createAskArticleSubmissionConsentReply( sessionId: number ): Message { const btnText = `🆕 ${t`Report to database`}`; - const spans: FlexSpan[] = [ - { - type: 'span', - text: t`Currently we don’t have this message in our database. If you think it is most likely a rumor, `, - }, - { - type: 'span', - text: t`press “${btnText}” to make this message public on Cofacts database `, - color: '#ffb600', - weight: 'bold', - }, - { - type: 'span', - text: t`and have volunteers fact-check it. This way you can help the people who receive the same message in the future.`, - }, - ]; return { type: 'flex', @@ -184,7 +168,92 @@ export function createAskArticleSubmissionConsentReply( { type: 'text', wrap: true, - contents: spans, + text: t`We currently don’t have this message in our database.`, + }, + { + type: 'text', + wrap: true, + text: t`If you believe:`, + }, + { + type: 'box', + layout: 'horizontal', + contents: [ + { + type: 'text', + text: '🤔', + flex: 0, + margin: 'none', + }, + { + type: 'text', + wrap: true, + flex: 1, + margin: 'md', + contents: [ + { + type: 'span', + text: /* t: If you believe ~ a rumor */ t`That it is most likely `, + }, + { + type: 'span', + text: /* t: If you believe that it is most likely ~ */ t`a rumor,`, + decoration: 'none', + color: '#ffb600', + weight: 'bold', + }, + ], + }, + ], + margin: 'md', + }, + { + type: 'box', + layout: 'horizontal', + contents: [ + { + type: 'text', + text: '🌐', + flex: 0, + margin: 'none', + }, + { + type: 'text', + wrap: true, + flex: 1, + margin: 'md', + contents: [ + { + type: 'span', + text: /* t: ~ make this messasge public */ t`And you are willing to `, + }, + { + type: 'span', + text: /* t: and you are willing to ~ */ t`make this message public`, + decoration: 'none', + color: '#ffb600', + weight: 'bold', + }, + ], + }, + ], + margin: 'md', + }, + { + type: 'text', + wrap: true, + contents: [ + { + type: 'span', + text: t`Press “${btnText}” to make this message public on Cofacts website `, + color: '#ffb600', + weight: 'bold', + }, + { + type: 'span', + text: t`and have volunteers fact-check it. This way you can help the people who receive the same message in the future.`, + }, + ], }, ], },