Stop the user from posting before the link card finishes loading (#2328)

* Stop the user from posting before the link card finishes loading

* Add localization of error messages
zio/stable
Paul Frazee 2023-12-27 08:47:26 -08:00 committed by GitHub
parent e27ffc850a
commit 3b240db0c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 96 additions and 44 deletions

View File

@ -110,11 +110,11 @@ msgstr "Einzelheiten hinzufügen"
msgid "Add details to report"
msgstr "Einzelheiten zum Bericht hinzufügen"
#: src/view/com/composer/Composer.tsx:438
#: src/view/com/composer/Composer.tsx:442
msgid "Add link card"
msgstr "Link Karte hinzufügen"
#: src/view/com/composer/Composer.tsx:441
#: src/view/com/composer/Composer.tsx:445
msgid "Add link card:"
msgstr "Link Karte hinzufügen:"
@ -345,8 +345,8 @@ msgstr "Kamera"
msgid "Can only contain letters, numbers, spaces, dashes, and underscores. Must be at least 4 characters long, but no more than 32 characters long."
msgstr "Darf nur Buchstaben, Zahlen, Leerzeichen, Bindestriche und Unterstriche enthalten. Muss mindestens 4 Zeichen lang sein, darf aber nicht länger als 32 Zeichen sein."
#: src/view/com/composer/Composer.tsx:285
#: src/view/com/composer/Composer.tsx:288
#: src/view/com/composer/Composer.tsx:289
#: src/view/com/composer/Composer.tsx:292
#: src/view/com/modals/AltImage.tsx:128
#: src/view/com/modals/ChangeEmail.tsx:218
#: src/view/com/modals/ChangeEmail.tsx:220
@ -669,6 +669,10 @@ msgstr "Entwicklungs-Server"
msgid "Developer Tools"
msgstr "Werkzeuge für Entwickler"
#: src/view/com/composer/Composer.tsx:210
msgid "Did you want to say anything?"
msgstr ""
#: src/view/com/composer/Composer.tsx:143
msgid "Discard"
msgstr "Verwerfen"
@ -1398,7 +1402,7 @@ msgstr "Ach nein!"
msgid "Okay"
msgstr "Okay"
#: src/view/com/composer/Composer.tsx:354
#: src/view/com/composer/Composer.tsx:358
msgid "One or more images is missing alt text."
msgstr "Bei einem oder mehreren Bildern fehlt der Alt-Text."
@ -1526,7 +1530,11 @@ msgstr ""
#~ msgid "Please tell us why you think this decision was incorrect."
#~ msgstr "Bitte teilen Sie uns mit, warum diese Entscheidung Ihrer Meinung nach falsch war."
#: src/view/com/composer/Composer.tsx:337
#: src/view/com/composer/Composer.tsx:214
msgid "Please wait for your link card to finish loading"
msgstr ""
#: src/view/com/composer/Composer.tsx:341
#: src/view/com/post-thread/PostThread.tsx:225
#: src/view/screens/PostThread.tsx:80
msgid "Post"
@ -2358,7 +2366,7 @@ msgstr "Wer kann antworten."
msgid "Wide"
msgstr "Breit"
#: src/view/com/composer/Composer.tsx:409
#: src/view/com/composer/Composer.tsx:413
msgid "Write post"
msgstr "Posten schreiben"

View File

@ -130,11 +130,11 @@ msgstr ""
msgid "Add details to report"
msgstr ""
#: src/view/com/composer/Composer.tsx:438
#: src/view/com/composer/Composer.tsx:442
msgid "Add link card"
msgstr ""
#: src/view/com/composer/Composer.tsx:441
#: src/view/com/composer/Composer.tsx:445
msgid "Add link card:"
msgstr ""
@ -373,8 +373,8 @@ msgstr ""
msgid "Can only contain letters, numbers, spaces, dashes, and underscores. Must be at least 4 characters long, but no more than 32 characters long."
msgstr ""
#: src/view/com/composer/Composer.tsx:285
#: src/view/com/composer/Composer.tsx:288
#: src/view/com/composer/Composer.tsx:289
#: src/view/com/composer/Composer.tsx:292
#: src/view/com/modals/AltImage.tsx:128
#: src/view/com/modals/ChangeEmail.tsx:218
#: src/view/com/modals/ChangeEmail.tsx:220
@ -705,6 +705,10 @@ msgstr ""
msgid "Developer Tools"
msgstr ""
#: src/view/com/composer/Composer.tsx:210
msgid "Did you want to say anything?"
msgstr ""
#: src/view/com/composer/Composer.tsx:143
msgid "Discard"
msgstr ""
@ -1492,7 +1496,7 @@ msgstr ""
msgid "Okay"
msgstr ""
#: src/view/com/composer/Composer.tsx:354
#: src/view/com/composer/Composer.tsx:358
msgid "One or more images is missing alt text."
msgstr ""
@ -1620,7 +1624,11 @@ msgstr ""
#~ msgid "Please tell us why you think this decision was incorrect."
#~ msgstr ""
#: src/view/com/composer/Composer.tsx:337
#: src/view/com/composer/Composer.tsx:214
msgid "Please wait for your link card to finish loading"
msgstr ""
#: src/view/com/composer/Composer.tsx:341
#: src/view/com/post-thread/PostThread.tsx:225
#: src/view/screens/PostThread.tsx:80
msgid "Post"
@ -2497,7 +2505,7 @@ msgstr ""
msgid "Wide"
msgstr ""
#: src/view/com/composer/Composer.tsx:409
#: src/view/com/composer/Composer.tsx:413
msgid "Write post"
msgstr ""

View File

@ -110,11 +110,11 @@ msgstr "Agregar detalles"
msgid "Add details to report"
msgstr "Agregar detalles al informe"
#: src/view/com/composer/Composer.tsx:438
#: src/view/com/composer/Composer.tsx:442
msgid "Add link card"
msgstr "Agregar una tarjeta de enlace"
#: src/view/com/composer/Composer.tsx:441
#: src/view/com/composer/Composer.tsx:445
msgid "Add link card:"
msgstr "Agregar una tarjeta de enlace:"
@ -345,8 +345,8 @@ msgstr "Cámara"
msgid "Can only contain letters, numbers, spaces, dashes, and underscores. Must be at least 4 characters long, but no more than 32 characters long."
msgstr "Sólo puede contener letras, números, espacios, guiones y guiones bajos. Debe tener al menos 4 caracteres, pero no más de 32."
#: src/view/com/composer/Composer.tsx:285
#: src/view/com/composer/Composer.tsx:288
#: src/view/com/composer/Composer.tsx:289
#: src/view/com/composer/Composer.tsx:292
#: src/view/com/modals/AltImage.tsx:128
#: src/view/com/modals/ChangeEmail.tsx:218
#: src/view/com/modals/ChangeEmail.tsx:220
@ -669,6 +669,10 @@ msgstr "Servidor de desarrollo"
msgid "Developer Tools"
msgstr "Herramientas de desarrollador"
#: src/view/com/composer/Composer.tsx:210
msgid "Did you want to say anything?"
msgstr ""
#: src/view/com/composer/Composer.tsx:143
msgid "Discard"
msgstr "Descartar"
@ -1398,7 +1402,7 @@ msgstr "¡Qué problema!"
msgid "Okay"
msgstr "Está bien"
#: src/view/com/composer/Composer.tsx:354
#: src/view/com/composer/Composer.tsx:358
msgid "One or more images is missing alt text."
msgstr "Falta el texto alternativo en una o varias imágenes."
@ -1526,7 +1530,11 @@ msgstr ""
#~ msgid "Please tell us why you think this decision was incorrect."
#~ msgstr "Por favor, dinos por qué crees que esta decisión fue incorrecta."
#: src/view/com/composer/Composer.tsx:337
#: src/view/com/composer/Composer.tsx:214
msgid "Please wait for your link card to finish loading"
msgstr ""
#: src/view/com/composer/Composer.tsx:341
#: src/view/com/post-thread/PostThread.tsx:225
#: src/view/screens/PostThread.tsx:80
msgid "Post"
@ -2358,7 +2366,7 @@ msgstr "Quién puede responder"
msgid "Wide"
msgstr "Ancho"
#: src/view/com/composer/Composer.tsx:409
#: src/view/com/composer/Composer.tsx:413
msgid "Write post"
msgstr "Redactar una publicación"

View File

@ -110,11 +110,11 @@ msgstr "Ajouter des détails"
msgid "Add details to report"
msgstr "Ajouter des détails au rapport"
#: src/view/com/composer/Composer.tsx:438
#: src/view/com/composer/Composer.tsx:442
msgid "Add link card"
msgstr "Ajouter une carte link card"
#: src/view/com/composer/Composer.tsx:441
#: src/view/com/composer/Composer.tsx:445
msgid "Add link card:"
msgstr "Ajouter une carte link card :"
@ -345,8 +345,8 @@ msgstr "Caméra"
msgid "Can only contain letters, numbers, spaces, dashes, and underscores. Must be at least 4 characters long, but no more than 32 characters long."
msgstr "Ne peut contenir que des lettres, des chiffres, des espaces, des tirets et des tirets bas. La longueur doit être dau moins 4 caractères, mais pas plus de 32."
#: src/view/com/composer/Composer.tsx:285
#: src/view/com/composer/Composer.tsx:288
#: src/view/com/composer/Composer.tsx:289
#: src/view/com/composer/Composer.tsx:292
#: src/view/com/modals/AltImage.tsx:128
#: src/view/com/modals/ChangeEmail.tsx:218
#: src/view/com/modals/ChangeEmail.tsx:220
@ -669,6 +669,10 @@ msgstr "Serveur de dév"
msgid "Developer Tools"
msgstr "Outils du dév"
#: src/view/com/composer/Composer.tsx:210
msgid "Did you want to say anything?"
msgstr ""
#: src/view/com/composer/Composer.tsx:143
msgid "Discard"
msgstr "Ignorer"
@ -1398,7 +1402,7 @@ msgstr "Oh non !"
msgid "Okay"
msgstr "Daccord"
#: src/view/com/composer/Composer.tsx:354
#: src/view/com/composer/Composer.tsx:358
msgid "One or more images is missing alt text."
msgstr "Une ou plusieurs images nont pas de texte alt."
@ -1526,7 +1530,11 @@ msgstr ""
#~ msgid "Please tell us why you think this decision was incorrect."
#~ msgstr "Dites-nous pourquoi vous pensez que cette décision était incorrecte."
#: src/view/com/composer/Composer.tsx:337
#: src/view/com/composer/Composer.tsx:214
msgid "Please wait for your link card to finish loading"
msgstr ""
#: src/view/com/composer/Composer.tsx:341
#: src/view/com/post-thread/PostThread.tsx:225
#: src/view/screens/PostThread.tsx:80
msgid "Post"
@ -2358,7 +2366,7 @@ msgstr "Qui peut répondre ?"
msgid "Wide"
msgstr "Large"
#: src/view/com/composer/Composer.tsx:409
#: src/view/com/composer/Composer.tsx:413
msgid "Write post"
msgstr "Rédiger une publication"

View File

@ -130,11 +130,11 @@ msgstr "विवरण जोड़ें"
msgid "Add details to report"
msgstr "रिपोर्ट करने के लिए विवरण जोड़ें"
#: src/view/com/composer/Composer.tsx:438
#: src/view/com/composer/Composer.tsx:442
msgid "Add link card"
msgstr "लिंक कार्ड जोड़ें"
#: src/view/com/composer/Composer.tsx:441
#: src/view/com/composer/Composer.tsx:445
msgid "Add link card:"
msgstr "लिंक कार्ड जोड़ें:"
@ -373,8 +373,8 @@ msgstr "कैमरा"
msgid "Can only contain letters, numbers, spaces, dashes, and underscores. Must be at least 4 characters long, but no more than 32 characters long."
msgstr "केवल अक्षर, संख्या, रिक्त स्थान, डैश और अंडरस्कोर हो सकते हैं। कम से कम 4 अक्षर लंबा होना चाहिए, लेकिन 32 अक्षरों से अधिक लंबा नहीं होना चाहिए।।"
#: src/view/com/composer/Composer.tsx:285
#: src/view/com/composer/Composer.tsx:288
#: src/view/com/composer/Composer.tsx:289
#: src/view/com/composer/Composer.tsx:292
#: src/view/com/modals/AltImage.tsx:128
#: src/view/com/modals/ChangeEmail.tsx:218
#: src/view/com/modals/ChangeEmail.tsx:220
@ -701,6 +701,10 @@ msgstr "देव सर्वर"
msgid "Developer Tools"
msgstr "डेवलपर उपकरण"
#: src/view/com/composer/Composer.tsx:210
msgid "Did you want to say anything?"
msgstr ""
#: src/view/com/composer/Composer.tsx:143
msgid "Discard"
msgstr ""
@ -1484,7 +1488,7 @@ msgstr "अरे नहीं!"
msgid "Okay"
msgstr "ठीक है"
#: src/view/com/composer/Composer.tsx:354
#: src/view/com/composer/Composer.tsx:358
msgid "One or more images is missing alt text."
msgstr "एक या अधिक छवियाँ alt पाठ याद आती हैं।।"
@ -1612,7 +1616,11 @@ msgstr ""
#~ msgid "Please tell us why you think this decision was incorrect."
#~ msgstr ""
#: src/view/com/composer/Composer.tsx:337
#: src/view/com/composer/Composer.tsx:214
msgid "Please wait for your link card to finish loading"
msgstr ""
#: src/view/com/composer/Composer.tsx:341
#: src/view/com/post-thread/PostThread.tsx:225
#: src/view/screens/PostThread.tsx:80
msgid "Post"
@ -2489,7 +2497,7 @@ msgstr ""
msgid "Wide"
msgstr "चौड़ा"
#: src/view/com/composer/Composer.tsx:409
#: src/view/com/composer/Composer.tsx:413
msgid "Write post"
msgstr "पोस्ट लिखो"

View File

@ -110,11 +110,11 @@ msgstr "詳細を追加"
msgid "Add details to report"
msgstr "レポートに詳細を追加"
#: src/view/com/composer/Composer.tsx:438
#: src/view/com/composer/Composer.tsx:442
msgid "Add link card"
msgstr "リンクカードを追加"
#: src/view/com/composer/Composer.tsx:441
#: src/view/com/composer/Composer.tsx:445
msgid "Add link card:"
msgstr "リンクカードを追加:"
@ -345,8 +345,8 @@ msgstr "カメラ"
msgid "Can only contain letters, numbers, spaces, dashes, and underscores. Must be at least 4 characters long, but no more than 32 characters long."
msgstr "文字、数字、スペース、ハイフン、およびアンダースコアのみが使用可能です。長さは4文字以上32文字以下である必要があります。"
#: src/view/com/composer/Composer.tsx:285
#: src/view/com/composer/Composer.tsx:288
#: src/view/com/composer/Composer.tsx:289
#: src/view/com/composer/Composer.tsx:292
#: src/view/com/modals/AltImage.tsx:128
#: src/view/com/modals/ChangeEmail.tsx:218
#: src/view/com/modals/ChangeEmail.tsx:220
@ -669,6 +669,10 @@ msgstr "開発者サーバー"
msgid "Developer Tools"
msgstr "開発者ツール"
#: src/view/com/composer/Composer.tsx:210
msgid "Did you want to say anything?"
msgstr ""
#: src/view/com/composer/Composer.tsx:143
msgid "Discard"
msgstr "破棄"
@ -1410,7 +1414,7 @@ msgstr "ちょっと!"
msgid "Okay"
msgstr "OK"
#: src/view/com/composer/Composer.tsx:354
#: src/view/com/composer/Composer.tsx:358
msgid "One or more images is missing alt text."
msgstr "1つもしくは複数の画像にALTテキストがありません。"
@ -1538,7 +1542,11 @@ msgstr ""
#~ msgid "Please tell us why you think this decision was incorrect."
#~ msgstr "この判断が誤っていると考える理由を教えてください。"
#: src/view/com/composer/Composer.tsx:337
#: src/view/com/composer/Composer.tsx:214
msgid "Please wait for your link card to finish loading"
msgstr ""
#: src/view/com/composer/Composer.tsx:341
#: src/view/com/post-thread/PostThread.tsx:225
#: src/view/screens/PostThread.tsx:80
msgid "Post"
@ -2370,7 +2378,7 @@ msgstr "返信できるユーザー"
msgid "Wide"
msgstr "ワイド"
#: src/view/com/composer/Composer.tsx:409
#: src/view/com/composer/Composer.tsx:413
msgid "Write post"
msgstr "投稿を書く"

View File

@ -207,7 +207,11 @@ export const ComposePost = observer(function ComposePost({
setError('')
if (richtext.text.trim().length === 0 && gallery.isEmpty && !extLink) {
setError('Did you want to say anything?')
setError(_(msg`Did you want to say anything?`))
return
}
if (extLink?.isLoading) {
setError(_(msg`Please wait for your link card to finish loading`))
return
}
@ -438,7 +442,7 @@ export const ComposePost = observer(function ComposePost({
accessibilityLabel={_(msg`Add link card`)}
accessibilityHint={`Creates a card with a thumbnail. The card links to ${url}`}>
<Text style={pal.text}>
<Trans>Add link card:</Trans>
<Trans>Add link card:</Trans>{' '}
<Text style={[pal.link, s.ml5]}>{toShortUrl(url)}</Text>
</Text>
</TouchableOpacity>