From 3a8bfbf7e0426a2db7b82d0569b807d3bb859199 Mon Sep 17 00:00:00 2001
From: Luke Barnard
Date: Wed, 27 Sep 2017 17:11:30 +0100
Subject: [PATCH 01/10] 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 02/10] 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": "您一定是",
From c7728bd9ade40ca407fd7ae2f714d9612ff75749 Mon Sep 17 00:00:00 2001
From: Luke Barnard
Date: Thu, 28 Sep 2017 10:02:40 +0100
Subject: [PATCH 03/10] Add eslint rule to disallow spaces inside of curly
braces
---
.eslintrc.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.eslintrc.js b/.eslintrc.js
index 74790a2964..f7a78223ff 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -40,6 +40,10 @@ module.exports = {
}],
"react/jsx-key": ["error"],
+ // Assert no spacing in JSX curly brackets
+ //
+ "react/jsx-curly-spacing": ["error", "never"],
+
/** flowtype **/
"flowtype/require-parameter-type": ["warn", {
"excludeArrowFunctions": true,
From 38fdd155f0089500a898558c137b9a0ff2271970 Mon Sep 17 00:00:00 2001
From: Luke Barnard
Date: Wed, 27 Sep 2017 17:11:30 +0100
Subject: [PATCH 04/10] 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 e9cf25f946cbf1bb18cd1b18c93b1bb888c69acf Mon Sep 17 00:00:00 2001
From: Luke Barnard
Date: Wed, 27 Sep 2017 17:55:04 +0100
Subject: [PATCH 05/10] 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": "您一定是",
From 6eedf8b07331a2c3d62f84a8d9bb1dba107e4ba6 Mon Sep 17 00:00:00 2001
From: Luke Barnard
Date: Thu, 28 Sep 2017 10:02:40 +0100
Subject: [PATCH 06/10] Add eslint rule to disallow spaces inside of curly
braces
---
.eslintrc.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.eslintrc.js b/.eslintrc.js
index 74790a2964..f7a78223ff 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -40,6 +40,10 @@ module.exports = {
}],
"react/jsx-key": ["error"],
+ // Assert no spacing in JSX curly brackets
+ //
+ "react/jsx-curly-spacing": ["error", "never"],
+
/** flowtype **/
"flowtype/require-parameter-type": ["warn", {
"excludeArrowFunctions": true,
From e70336af11342bf6d466a234ed6e37ebd733a2a3 Mon Sep 17 00:00:00 2001
From: Luke Barnard
Date: Thu, 28 Sep 2017 10:27:03 +0100
Subject: [PATCH 07/10] Add rule to enforce JSX tag spacing
---
.eslintrc.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.eslintrc.js b/.eslintrc.js
index f7a78223ff..425f2d2001 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -42,8 +42,17 @@ module.exports = {
// Assert no spacing in JSX curly brackets
//
+ //
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-curly-spacing.md
"react/jsx-curly-spacing": ["error", "never"],
+ // Assert spacing before self-closing JSX tags, and no spacing before or
+ // after the closing slash, and no spacing after the opening bracket of
+ // the opening tag or closing tag.
+ //
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-tag-spacing.md
+ "react/jsx-tag-spacing": ["error"],
+
/** flowtype **/
"flowtype/require-parameter-type": ["warn", {
"excludeArrowFunctions": true,
From 3c99b2af3d3e65aa0c32532559f8d5ebf0ff2e7e Mon Sep 17 00:00:00 2001
From: Luke Barnard
Date: Thu, 28 Sep 2017 10:55:09 +0100
Subject: [PATCH 08/10] Fix ability to invite existing mx users
Bug introduced by https://github.com/matrix-org/matrix-react-sdk/pull/1432
We should really not be using string constant literals all over the place.
We'd be less likely to run into this sort of bug these address types weren't copied literals.
---
src/RoomInvite.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/RoomInvite.js b/src/RoomInvite.js
index af0ba3d1e7..ceb3dd0fda 100644
--- a/src/RoomInvite.js
+++ b/src/RoomInvite.js
@@ -28,7 +28,7 @@ export function inviteToRoom(roomId, addr) {
if (addrType == 'email') {
return MatrixClientPeg.get().inviteByEmail(roomId, addr);
- } else if (addrType == 'mx') {
+ } else if (addrType == 'mx-user-id') {
return MatrixClientPeg.get().invite(roomId, addr);
} else {
throw new Error('Unsupported address');
From 6b9a2909dff889cc74bc73a3bee4388f5e5d77f8 Mon Sep 17 00:00:00 2001
From: Luke Barnard
Date: Thu, 28 Sep 2017 11:21:06 +0100
Subject: [PATCH 09/10] Add rule to enforce spacing in curly brackets in JSX
children
This required an updated in version of eslint-plugin-react to 7.4.0.
---
.eslintrc.js | 2 +-
jenkins.sh | 4 +-
package.json | 3 +-
src/SlashCommands.js | 4 +-
.../views/dialogs/ExportE2eKeysDialog.js | 8 +-
.../views/dialogs/ImportE2eKeysDialog.js | 10 +-
src/autocomplete/CommandProvider.js | 4 +-
src/autocomplete/RoomProvider.js | 2 +-
src/components/structures/GroupView.js | 146 +++++++-------
src/components/structures/MatrixChat.js | 4 +-
src/components/structures/MyGroups.js | 26 +--
src/components/structures/UserSettings.js | 184 +++++++++---------
.../views/dialogs/AddressPickerDialog.js | 20 +-
.../views/dialogs/ConfirmRedactDialog.js | 10 +-
.../views/dialogs/ConfirmUserActionDialog.js | 14 +-
.../views/dialogs/CreateGroupDialog.js | 12 +-
.../views/dialogs/DeviceVerifyDialog.js | 16 +-
src/components/views/dialogs/ErrorDialog.js | 4 +-
.../views/dialogs/KeyShareDialog.js | 12 +-
.../views/dialogs/QuestionDialog.js | 12 +-
.../dialogs/SessionRestoreErrorDialog.js | 18 +-
.../views/dialogs/SetEmailDialog.js | 6 +-
src/components/views/dialogs/SetMxIdDialog.js | 12 +-
.../views/dialogs/TextInputDialog.js | 6 +-
.../views/elements/AppPermission.js | 8 +-
src/components/views/elements/AppTile.js | 14 +-
src/components/views/elements/AppWarning.js | 4 +-
src/components/views/elements/Flair.js | 4 +-
.../views/elements/ManageIntegsButton.js | 6 +-
.../views/elements/MessageSpinner.js | 4 +-
src/components/views/elements/Pill.js | 12 +-
.../views/elements/TruncatedList.js | 6 +-
.../views/groups/GroupInviteTile.js | 8 +-
.../views/groups/GroupMemberInfo.js | 14 +-
.../views/groups/GroupMemberList.js | 4 +-
src/components/views/groups/GroupRoomList.js | 4 +-
src/components/views/groups/GroupRoomTile.js | 4 +-
src/components/views/login/LoginFooter.js | 2 +-
.../views/messages/SenderProfile.js | 6 +-
src/components/views/messages/UnknownBody.js | 2 +-
src/components/views/rooms/AppsDrawer.js | 6 +-
src/components/views/rooms/ForwardMessage.js | 2 +-
src/components/views/rooms/RoomHeader.js | 38 ++--
.../views/rooms/SimpleRoomHeader.js | 2 +-
src/components/views/voip/CallView.js | 10 +-
src/components/views/voip/IncomingCallBox.js | 6 +-
src/components/views/voip/VideoView.js | 4 +-
47 files changed, 355 insertions(+), 354 deletions(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index 425f2d2001..429aa24993 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -44,7 +44,7 @@ module.exports = {
//
//
// https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-curly-spacing.md
- "react/jsx-curly-spacing": ["error", "never"],
+ "react/jsx-curly-spacing": ["error", {"when": "never", "children": {"when": "always"}}],
// Assert spacing before self-closing JSX tags, and no spacing before or
// after the closing slash, and no spacing after the opening bracket of
diff --git a/jenkins.sh b/jenkins.sh
index 0979edfa13..3a2d66739e 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -21,9 +21,7 @@ npm run test -- --no-colors
npm run lintall -- -f checkstyle -o eslint.xml || true
# re-run the linter, excluding any files known to have errors or warnings.
-./node_modules/.bin/eslint --max-warnings 0 \
- --ignore-path .eslintignore.errorfiles \
- src test
+npm run lintwithexclusions
# delete the old tarball, if it exists
rm -f matrix-react-sdk-*.tgz
diff --git a/package.json b/package.json
index e9b4aa9a53..e185a9027d 100644
--- a/package.json
+++ b/package.json
@@ -39,6 +39,7 @@
"start": "parallelshell \"npm run build:watch\" \"npm run reskindex:watch\"",
"lint": "eslint src/",
"lintall": "eslint src/ test/",
+ "lintwithexclusions": "eslint --max-warnings 0 --ignore-path .eslintignore.errorfiles src test",
"clean": "rimraf lib",
"prepublish": "npm run clean && npm run build && git rev-parse HEAD > git-revision.txt",
"test": "karma start --single-run=true --browsers ChromeHeadless",
@@ -99,7 +100,7 @@
"eslint-config-google": "^0.7.1",
"eslint-plugin-babel": "^4.0.1",
"eslint-plugin-flowtype": "^2.30.0",
- "eslint-plugin-react": "^6.9.0",
+ "eslint-plugin-react": "^7.4.0",
"expect": "^1.16.0",
"json-loader": "^0.5.3",
"karma": "^1.7.0",
diff --git a/src/SlashCommands.js b/src/SlashCommands.js
index 1302aaa423..82665cc2f3 100644
--- a/src/SlashCommands.js
+++ b/src/SlashCommands.js
@@ -254,7 +254,7 @@ const commands = {
title: _t("Ignored user"),
description: (
-
{_t("You are now ignoring %(userId)s", {userId: userId})}
+
{ _t("You are now ignoring %(userId)s", {userId: userId}) }
- {_t("%(inviter)s has invited you to join this group", {inviter: group.inviter.userId})}
+ { _t("%(inviter)s has invited you to join this group", {inviter: group.inviter.userId}) }
- {_t('Error whilst fetching joined groups')}
+ { _t('Error whilst fetching joined groups') }
;
} else {
content = ;
}
return
-
+
- {_t('Create a new group')}
+ { _t('Create a new group') }
- {_t(
+ { _t(
'Create a group to represent your community! '+
'Define a set of rooms and your own custom homepage '+
'to mark out your space in the Matrix universe.',
- )}
+ ) }
- {_t('Join an existing group')}
+ { _t('Join an existing group') }
- {_tJsx(
+ { _tJsx(
'To join an existing group you\'ll have to '+
'know its group identifier; this will look '+
'something like +example:matrix.org.',
/(.*)<\/i>/,
- (sub) => {sub},
- )}
+ (sub) => { sub },
+ ) }