From 3a8bfbf7e0426a2db7b82d0569b807d3bb859199 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 27 Sep 2017 17:11:30 +0100 Subject: [PATCH 1/2] Construct address picker message using provided `validAddressTypes` --- .../views/dialogs/AddressPickerDialog.js | 17 +++++++++++++++-- src/i18n/strings/en_EN.json | 7 ++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index c72510cbe7..4610388afc 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -419,7 +419,7 @@ module.exports = React.createClass({ address: addressText, isKnown: false, }; - if (addrType == null) { + if (!this.props.validAddressTypes.includes(addrType)) { this.setState({ error: true }); return null; } else if (addrType == 'mx-user-id') { @@ -517,8 +517,21 @@ module.exports = React.createClass({ let error; let addressSelector; if (this.state.error) { + let tryUsing = ''; + const validTypeDescriptions = this.props.validAddressTypes.map((t) => { + return { + 'mx-user-id': _t("Matrix ID"), + 'mx-room-id': _t("Matrix Room ID"), + 'email': _t("email address"), + }[t]; + }); + tryUsing = _t("Try using one of the following valid address types: %(validTypesList)s.", { + validTypesList: validTypeDescriptions.join(", "), + }); error =
- {_t("You have entered an invalid contact. Try using their Matrix ID or email address.")} + {_t("You have entered an invalid address.")} +
+ {tryUsing}
; } else if (this.state.searchError) { error =
{this.state.searchError}
; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 09b3f045df..a4219d7467 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -891,5 +891,10 @@ "Unpublish": "Unpublish", "This group is published on your profile": "This group is published on your profile", "Publish": "Publish", - "This group is not published on your profile": "This group is not published on your profile" + "This group is not published on your profile": "This group is not published on your profile", + "Matrix ID": "Matrix ID", + "Matrix Room ID": "Matrix Room ID", + "email address": "email address", + "Try using one of the following valid address types: %(validTypesList)s.": "Try using one of the following valid address types: %(validTypesList)s.", + "You have entered an invalid address.": "You have entered an invalid address." } From 1f66baca4bbece167f587d5c1048a8b5ad644ab0 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 27 Sep 2017 17:55:04 +0100 Subject: [PATCH 2/2] Remove "You have entered an invalid contact..." from translations --- src/i18n/strings/de_DE.json | 1 - src/i18n/strings/el.json | 1 - src/i18n/strings/en_EN.json | 1 - src/i18n/strings/en_US.json | 1 - src/i18n/strings/es.json | 1 - src/i18n/strings/eu.json | 1 - src/i18n/strings/fr.json | 1 - src/i18n/strings/hu.json | 1 - src/i18n/strings/ko.json | 1 - src/i18n/strings/lv.json | 1 - src/i18n/strings/nl.json | 1 - src/i18n/strings/pl.json | 1 - src/i18n/strings/pt.json | 1 - src/i18n/strings/pt_BR.json | 1 - src/i18n/strings/ru.json | 1 - src/i18n/strings/tr.json | 1 - src/i18n/strings/zh_Hans.json | 1 - src/i18n/strings/zh_Hant.json | 1 - 18 files changed, 18 deletions(-) diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index e3c589bbb2..aa114e241d 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -734,7 +734,6 @@ "WARNING: KEY VERIFICATION FAILED! The signing key for %(userId)s and device %(deviceId)s is \"%(fprint)s\" which does not match the provided key \"%(fingerprint)s\". This could mean your communications are being intercepted!": "WARNUNG: SCHLÜSSEL-VERIFIZIERUNG FEHLGESCHLAGEN! Der Signatur-Schlüssel für %(userId)s und das Gerät %(deviceId)s ist \"%(fprint)s\", welcher nicht mit dem bereitgestellten Schlüssel \"%(fingerprint)s\" übereinstimmt. Dies kann bedeuten, dass deine Kommunikation abgehört wird!", "You have disabled URL previews by default.": "Du hast die URL-Vorschau standardmäßig deaktiviert.", "You have enabled URL previews by default.": "Du hast die URL-Vorschau standardmäßig aktiviert.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Du hast einen ungültigen Kontakt eingegeben. Versuche es mit der Matrix-Kennung oder der E-Mail-Adresse des Kontakts.", "$senderDisplayName changed the room avatar to ": "$senderDisplayName hat das Raum-Bild geändert zu ", "%(senderDisplayName)s changed the avatar for %(roomName)s": "%(senderDisplayName)s hat das Raum-Bild für %(roomName)s geändert", "Hide removed messages": "Gelöschte Nachrichten verbergen", diff --git a/src/i18n/strings/el.json b/src/i18n/strings/el.json index 5cee10d3d7..bc45e6da9e 100644 --- a/src/i18n/strings/el.json +++ b/src/i18n/strings/el.json @@ -685,7 +685,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "Έχετε αποσυνδεθεί από όλες τις συσκευές και δεν θα λαμβάνετε πλέον ειδοποιήσεις push. Για να ενεργοποιήσετε τις ειδοποιήσεις, συνδεθείτε ξανά σε κάθε συσκευή", "You have disabled URL previews by default.": "Έχετε απενεργοποιημένη από προεπιλογή την προεπισκόπηση συνδέσμων.", "You have enabled URL previews by default.": "Έχετε ενεργοποιημένη από προεπιλογή την προεπισκόπηση συνδέσμων.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Έχετε πληκτρολογήσει μια άκυρη επαφή. Χρησιμοποιήστε το Matrix ID ή την ηλεκτρονική διεύθυνση αλληλογραφίας τους.", "You may wish to login with a different account, or add this email to this account.": "Μπορεί να θέλετε να συνδεθείτε με διαφορετικό λογαριασμό, ή να προσθέσετε αυτή τη διεύθυνση ηλεκτρονικής αλληλογραφίας σε αυτόν τον λογαριασμό.", "You need to be able to invite users to do that.": "Για να το κάνετε αυτό πρέπει να έχετε τη δυνατότητα να προσκαλέσετε χρήστες.", "You seem to be uploading files, are you sure you want to quit?": "Φαίνεται ότι αποστέλετε αρχεία, είστε βέβαιοι ότι θέλετε να αποχωρήσετε;", diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index a4219d7467..87fd6d4364 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -554,7 +554,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device", "You have disabled URL previews by default.": "You have disabled URL previews by default.", "You have enabled URL previews by default.": "You have enabled URL previews by default.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "You have entered an invalid contact. Try using their Matrix ID or email address.", "You have no visible notifications": "You have no visible notifications", "You may wish to login with a different account, or add this email to this account.": "You may wish to login with a different account, or add this email to this account.", "you must be a": "you must be a", diff --git a/src/i18n/strings/en_US.json b/src/i18n/strings/en_US.json index 6e182c5334..928f1a9d0f 100644 --- a/src/i18n/strings/en_US.json +++ b/src/i18n/strings/en_US.json @@ -478,7 +478,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device", "You have disabled URL previews by default.": "You have disabled URL previews by default.", "You have enabled URL previews by default.": "You have enabled URL previews by default.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "You have entered an invalid contact. Try using their Matrix ID or email address.", "You have no visible notifications": "You have no visible notifications", "you must be a": "you must be a", "You need to be able to invite users to do that.": "You need to be able to invite users to do that.", diff --git a/src/i18n/strings/es.json b/src/i18n/strings/es.json index f7bdc21874..bc2391a5c7 100644 --- a/src/i18n/strings/es.json +++ b/src/i18n/strings/es.json @@ -621,7 +621,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "Ha sido desconectado de todos los dispositivos y no continuara recibiendo notificaciones. Para volver a habilitar las notificaciones, vuelva a conectarse en cada dispositivo", "You have disabled URL previews by default.": "Ha deshabilitado la vista previa de URL por defecto.", "You have enabled URL previews by default.": "Ha habilitado vista previa de URL por defecto.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Ha ingresado un contacto no valido. Intente usando la ID Matrix o e-mail del contacto.", "You have no visible notifications": "No tiene notificaciones visibles", "You may wish to login with a different account, or add this email to this account.": "Puede ingresar con una cuenta diferente, o agregar este e-mail a esta cuenta.", "you must be a": "usted debe ser un", diff --git a/src/i18n/strings/eu.json b/src/i18n/strings/eu.json index 15e785114c..9f3d06ec52 100644 --- a/src/i18n/strings/eu.json +++ b/src/i18n/strings/eu.json @@ -555,7 +555,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "Saioa amaitu duzu eta ez dituzu jakinarazpenak jasoko. Jakinarazpenak jaso nahi badituzu hasi saioa berriro gailu bakoitzean", "You have disabled URL previews by default.": "Lehenetsita URLak aurreikustea desgaitu duzu.", "You have enabled URL previews by default.": "Lehenetsita URLak aurreikustea gaitu duzu.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Kontaktu baliogabea sartu duzu. Saiatu bere Matrix ID-a edo e-mail helbidea erabiltzen.", "You have no visible notifications": "Ez daukazu jakinarazpen ikusgairik", "You may wish to login with a different account, or add this email to this account.": "Agian beste kontu batekin hasi nahi duzu saioa, edo e-mail hau kontu honetara gehitu.", "you must be a": "hau izan behar duzu:", diff --git a/src/i18n/strings/fr.json b/src/i18n/strings/fr.json index 09761d2a6e..585e47f5a3 100644 --- a/src/i18n/strings/fr.json +++ b/src/i18n/strings/fr.json @@ -679,7 +679,6 @@ "Tagged as: ": "Étiquetter comme : ", "You have disabled URL previews by default.": "Vous avez désactivé les aperçus d’URL par défaut.", "You have enabled URL previews by default.": "Vous avez activé les aperçus d’URL par défaut.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Vous avez entré un contact invalide. Essayez d’utiliser leur identifiant Matrix ou leur adresse email.", "Hide removed messages": "Cacher les messages supprimés", "Add": "Ajouter", "%(count)s new messages|one": "%(count)s nouveau message", diff --git a/src/i18n/strings/hu.json b/src/i18n/strings/hu.json index 16a0e8b1d0..2c34e05b1a 100644 --- a/src/i18n/strings/hu.json +++ b/src/i18n/strings/hu.json @@ -529,7 +529,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "Kijelentkeztél minden eszközről így nem fogsz \"push\" értesítéseket kapni. Az értesítések engedélyezéséhez jelentkezz vissza mindegyik eszközön", "You have disabled URL previews by default.": "Az URL előnézet alapból tiltva van.", "You have enabled URL previews by default.": "Az URL előnézet alapból engedélyezve van.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Érvénytelen kapcsolatot adtál meg. Próbáld meg a Matrix azonosítóját vagy e-mail címét használni.", "You have no visible notifications": "Nincsenek látható értesítéseid", "You may wish to login with a different account, or add this email to this account.": "Lehet, hogy más fiókba szeretnél belépni vagy ezt az e-mail címet szeretnéd ehhez a fiókhoz kötni.", "you must be a": "szükséges szerep:", diff --git a/src/i18n/strings/ko.json b/src/i18n/strings/ko.json index c725ecdcd4..8b6e233437 100644 --- a/src/i18n/strings/ko.json +++ b/src/i18n/strings/ko.json @@ -535,7 +535,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "모든 장치에서 로그아웃되었고 더 이상 알림을 받지 않으실 거에요. 다시 알림을 받으시려면, 각 장치에 로그인해주세요", "You have disabled URL previews by default.": "URL 미리보기 쓰지 않기를 기본으로 하셨어요.", "You have enabled URL previews by default.": "URL 미리보기 쓰기를 기본으로 하셨어요.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "잘못된 연락처를 입력하셨어요. 매트릭스 ID나 이메일 주소를 써보세요.", "You have no visible notifications": "보여드릴 알림이 없어요", "You may wish to login with a different account, or add this email to this account.": "다른 계정으로 로그인하거나, 이 이메일을 이 계정에 추가할 수도 있어요.", "you must be a": "해야해요", diff --git a/src/i18n/strings/lv.json b/src/i18n/strings/lv.json index 7bdc0612c6..5f58fd9515 100644 --- a/src/i18n/strings/lv.json +++ b/src/i18n/strings/lv.json @@ -593,7 +593,6 @@ "You cannot place VoIP calls in this browser.": "Tu nevari veikt VoIP zvanus šajā pārlūkā.", "You do not have permission to post to this room": "Tev nav vajadzīgās atļaujas pievienot ziņas šajā istabā", "You have disabled URL previews by default.": "URL priekšskatījums pēc noklusējuma Tev ir atspējots.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Tu ievadīji nepareizu kontaktu. Mēģini izmantot viņa Matrix ID vai epasta adresi.", "You may wish to login with a different account, or add this email to this account.": "Tu varētu, iespējams, vēlēties pierakstīties no cita konta vai piesaistīt šo epastu šim kontam.", "you must be a": "Tev ir jābūt", "You must register to use this functionality": "Lai izmantotu šo funkcionalitāti, Tev ir jāreģistrējas", diff --git a/src/i18n/strings/nl.json b/src/i18n/strings/nl.json index a1e929bbd1..f770e335cf 100644 --- a/src/i18n/strings/nl.json +++ b/src/i18n/strings/nl.json @@ -560,7 +560,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "Je bent op alle apparaten uitgelegd en je zal niet langer notificaties ontvangen. Om notificaties weer aan te zetten, log op elk apparaat opnieuw in", "You have disabled URL previews by default.": "Je hebt URL-voorvertoningen standaard uitgezet.", "You have enabled URL previews by default.": "Je hebt URL-voorvertoningen standaard aangezet.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Je hebt een ongeldig contact ingevoerd. Probeer zijn of haar Matrix-ID of e-mailadres te gebruiken.", "You have no visible notifications": "Je hebt geen zichtbare notificaties", "You may wish to login with a different account, or add this email to this account.": "Je wilt misschien met een ander account inloggen of deze e-mail aan je account toevoegen.", "you must be a": "wat je moet zijn is een", diff --git a/src/i18n/strings/pl.json b/src/i18n/strings/pl.json index f049112d23..bd1e4c5c24 100644 --- a/src/i18n/strings/pl.json +++ b/src/i18n/strings/pl.json @@ -603,7 +603,6 @@ "You have been kicked from %(roomName)s by %(userName)s.": "Zostałeś usunięty z %(roomName)s przez %(userName)s.", "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "Wylogowałeś się ze wszystkich urządzeń i nie będziesz już otrzymywał powiadomień push. Aby ponownie aktywować powiadomienia zaloguj się ponownie na każdym urządzeniu", "You have disabled URL previews by default.": "Masz domyślnie wyłączone podglądy linków.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Wpisałeś niewłaściwy kontakt. Spróbuj używając Matrix ID lub adresu e-mail.", "You have no visible notifications": "Nie masz widocznych powiadomień", "You may wish to login with a different account, or add this email to this account.": "Możesz chcieć zalogować się z innego konta lub dodać e-mail do tego konta.", "you must be a": "musisz być", diff --git a/src/i18n/strings/pt.json b/src/i18n/strings/pt.json index 8d37776afb..ba4968b7ad 100644 --- a/src/i18n/strings/pt.json +++ b/src/i18n/strings/pt.json @@ -733,7 +733,6 @@ "Tagged as: ": "Marcado como: ", "You have disabled URL previews by default.": "Você desabilitou pré-visualizações de links por padrão.", "You have enabled URL previews by default.": "Você habilitou pré-visualizações de links por padrão.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Você inseriu um contato inválido. Tente usar o ID Matrix ou endereço de e-mail da pessoa que está buscando.", "You have been banned from %(roomName)s by %(userName)s.": "Você foi expulso(a) da sala %(roomName)s por %(userName)s.", "Send anyway": "Enviar de qualquer maneira", "This room": "Esta sala", diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index fc089a8191..af4804bd85 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -730,7 +730,6 @@ "Tagged as: ": "Marcado como: ", "You have disabled URL previews by default.": "Você desabilitou pré-visualizações de links por padrão.", "You have enabled URL previews by default.": "Você habilitou pré-visualizações de links por padrão.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Você inseriu um contato inválido. Tente usar o ID Matrix ou endereço de e-mail da pessoa que está buscando.", "Hide removed messages": "Ocultar mensagens removidas", "Add": "Adicionar", "%(count)s new messages|one": "%(count)s nova mensagem", diff --git a/src/i18n/strings/ru.json b/src/i18n/strings/ru.json index e0304a134a..cfab960e32 100644 --- a/src/i18n/strings/ru.json +++ b/src/i18n/strings/ru.json @@ -618,7 +618,6 @@ "WARNING: KEY VERIFICATION FAILED! The signing key for %(userId)s and device %(deviceId)s is \"%(fprint)s\" which does not match the provided key \"%(fingerprint)s\". This could mean your communications are being intercepted!": "ВНИМАНИЕ: ОШИБКА ПРОВЕРКИ КЛЮЧЕЙ! Ключ подписи пользователя %(userId)s на устройстве %(deviceId)s — \"%(fprint)s\", и он не соответствует предоставленному ключу \"%(fingerprint)s\". Это может означать, что ваше общение перехватывается!", "You have disabled URL previews by default.": "Предварительный просмотр ссылок отключен по-умолчанию.", "You have enabled URL previews by default.": "Предварительный просмотр ссылок включен по-умолчанию.", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Вы ввели недопустимый контакт. Попробуйте использовать Matrix ID или адрес электронной почты.", "You need to enter a user name.": "Необходимо ввести имя пользователя.", "You seem to be in a call, are you sure you want to quit?": "Звонок не завершен, вы уверены, что хотите выйти?", "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.": "Вы не сможете отменить это изменение, так как этот пользователь получит уровень доступа, аналогичный вашему.", diff --git a/src/i18n/strings/tr.json b/src/i18n/strings/tr.json index 82e9129f00..23d4e284bc 100644 --- a/src/i18n/strings/tr.json +++ b/src/i18n/strings/tr.json @@ -516,7 +516,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "Tüm cihazlardan çıkış yaptınız ve artık bildirimler almayacaksınız . Bildirimleri yeniden etkinleştirmek için , her cihazda tekrar giriş yapın", "You have disabled URL previews by default.": "URL önizlemelerini varsayılan olarak devre dışı bıraktınız.", "You have enabled URL previews by default.": "URL önizlemelerini varsayılan olarak etkinleştirdiniz .", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "Geçersiz bir kişi girdiniz . Matrix ID veya e-posta adresini kullanarak tekrar deneyin.", "You have no visible notifications": "Hiçbir görünür bildiriminiz yok", "You may wish to login with a different account, or add this email to this account.": "Farklı bir hesap ile giriş yapmak veya bu e-postayı bu hesaba eklemek istemiş olabilirsiniz.", "you must be a": "olabilirsiniz", diff --git a/src/i18n/strings/zh_Hans.json b/src/i18n/strings/zh_Hans.json index c4c29fc5c8..69ba19ca27 100644 --- a/src/i18n/strings/zh_Hans.json +++ b/src/i18n/strings/zh_Hans.json @@ -630,7 +630,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "你已经登出了所有的设备并不再接收推送通知。要重新启用通知,请再在每个设备上登录", "You have disabled URL previews by default.": "你已经默认 禁用 URL 预览。", "You have enabled URL previews by default.": "你已经默认 启用 URL 预览。", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "你输入了一个非法的联系人。尝试使用他们的 Matrix ID 或者电子邮件地址。", "Your home server does not support device management.": "你的 home server 不支持设备管理。", "Set a display name:": "设置一个昵称:", "This server does not support authentication with a phone number.": "这个服务器不支持用电话号码认证。", diff --git a/src/i18n/strings/zh_Hant.json b/src/i18n/strings/zh_Hant.json index a05b22d2a9..596bc55a01 100644 --- a/src/i18n/strings/zh_Hant.json +++ b/src/i18n/strings/zh_Hant.json @@ -574,7 +574,6 @@ "You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device": "您已在所有裝置上登出,並且不會再收到推送通知。要重新啟用通知,再次於每個裝置上登入", "You have disabled URL previews by default.": "您已預設停用 URL 預覽。", "You have enabled URL previews by default.": "您已預設啟用 URL 預覽。", - "You have entered an invalid contact. Try using their Matrix ID or email address.": "您輸入了無效的聯絡人。嘗試使用他們的 Matrix ID 或電子郵件地址。", "You have no visible notifications": "您沒有可見的通知", "You may wish to login with a different account, or add this email to this account.": "您可能會想要以不同的帳號登入,或是把這個電子郵件加入到此帳號中。", "you must be a": "您一定是",