From 415693bd834b14b946e492c9914782632e4cfe0b Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 29 Sep 2017 14:02:31 -0600 Subject: [PATCH 1/7] Support editing power levels of events. Signed-off-by: Travis Ralston --- src/components/views/rooms/RoomSettings.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 0fea50d2fa..b2d8aa7fe5 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -364,6 +364,11 @@ module.exports = React.createClass({ var powerLevels = this.props.room.currentState.getStateEvents('m.room.power_levels', ''); powerLevels = powerLevels ? powerLevels.getContent() : {}; + for (let key of Object.keys(this.refs).filter(k => k.startsWith("event_levels_"))) { + const eventType = key.substring("event_levels_".length); + powerLevels.events[eventType] = parseInt(this.refs[key].getValue()); + } + var newPowerLevels = { ban: parseInt(this.refs.ban.getValue()), kick: parseInt(this.refs.kick.getValue()), @@ -883,7 +888,8 @@ module.exports = React.createClass({ return (
{ _t('To send events of type') } { event_type }, { _t('you must be a') } - +
); })} From 2e1b2178a1f12be3c9a0da8054d15b5220e51903 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 29 Sep 2017 14:35:49 -0600 Subject: [PATCH 2/7] Remove assumptions on how languages work in the power levels section This does mean that the strings will need to be re-translated, but now they may be more accurate because the comma is not assumed in the code. Signed-off-by: Travis Ralston --- src/components/views/rooms/RoomSettings.js | 14 +++++++------- src/i18n/strings/de_DE.json | 6 ------ src/i18n/strings/el.json | 7 ------- src/i18n/strings/en_EN.json | 14 +++++++------- src/i18n/strings/en_US.json | 14 +++++++------- src/i18n/strings/es.json | 7 ------- src/i18n/strings/eu.json | 7 ------- src/i18n/strings/fr.json | 7 ------- src/i18n/strings/hu.json | 7 ------- src/i18n/strings/ko.json | 7 ------- src/i18n/strings/lv.json | 7 ------- src/i18n/strings/nl.json | 7 ------- src/i18n/strings/pl.json | 7 ------- src/i18n/strings/pt.json | 7 ------- src/i18n/strings/pt_BR.json | 7 ------- src/i18n/strings/ru.json | 7 ------- src/i18n/strings/th.json | 6 ------ src/i18n/strings/tr.json | 7 ------- src/i18n/strings/zh_Hant.json | 7 ------- 19 files changed, 21 insertions(+), 131 deletions(-) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index b2d8aa7fe5..942da9ba06 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -860,34 +860,34 @@ module.exports = React.createClass({
- { _t('To send messages') }, { _t('you must be a') } + { _t('To send messages, you must be a') }
- { _t('To invite users into the room') }, { _t('you must be a') } + { _t('To invite users into the room, you must be a') }
- { _t('To configure the room') }, { _t('you must be a') } + { _t('To configure the room, you must be a') }
- { _t('To kick users') }, { _t('you must be a') } + { _t('To kick users, you must be a') }
- { _t('To ban users') }, { _t('you must be a') } + { _t('To ban users, you must be a') }
- { _t('To remove other users\' messages') }, { _t('you must be a') } + { _t('To remove other users\' messages, you must be a') }
{Object.keys(events_levels).map(function(event_type, i) { return (
- { _t('To send events of type') } { event_type }, { _t('you must be a') } + { _tJsx("To send events of type , you must be a", //, () => { event_type }) }
diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index aa114e241d..1a05530890 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -212,11 +212,7 @@ "This is a preview of this room. Room interactions have been disabled": "Dies ist eine Vorschau dieses Raumes. Raum-Interaktionen wurden deaktiviert", "This room is not accessible by remote Matrix servers": "Remote-Matrix-Server können auf diesen Raum nicht zugreifen", "This room's internal ID is": "Die interne ID dieses Raumes ist", - "To ban users": "Um Benutzer zu verbannen", - "To configure the room": "Um den Raum zu konfigurieren", - "To invite users into the room": "Um Nutzer in den Raum einzuladen", "to join the discussion": "um an der Diskussion teilzunehmen", - "To kick users": "Um Benutzer zu kicken", "Admin": "Administrator", "Server may be unavailable, overloaded, or you hit a bug.": "Server ist nicht verfügbar, überlastet oder du bist auf einen Fehler gestoßen.", "Could not connect to the integration server": "Konnte keine Verbindung zum Integrations-Server herstellen", @@ -227,7 +223,6 @@ "Can't connect to homeserver - please check your connectivity and ensure your": "Die Verbindung mit dem Homeserver ist fehlgeschlagen. Bitte überprüfe deine Verbindung und stelle sicher, dass dein(e) ", "tag as": "kennzeichne als", "To reset your password, enter the email address linked to your account": "Um dein Passwort zurückzusetzen, gib bitte die mit deinem Account verknüpfte E-Mail-Adresse ein", - "To send messages": "Um Nachrichten zu senden", "turned on end-to-end encryption (algorithm": "aktivierte Ende-zu-Ende-Verschlüsselung (Algorithmus", "Unable to add email address": "E-Mail-Adresse konnte nicht hinzugefügt werden", "Unable to remove contact information": "Die Kontakt-Informationen konnten nicht gelöscht werden", @@ -412,7 +407,6 @@ "to tag direct chat": "als Direkt-Chat markieren", "You're not in any rooms yet! Press": "Du bist noch keinem Raum beigetreten! Drücke", "click to reveal": "anzeigen", - "To remove other users' messages": "Um Nachrichten anderer Nutzer zu verbergen", "You are trying to access %(roomName)s.": "Du versuchst, auf den Raum \"%(roomName)s\" zuzugreifen.", "Monday": "Montag", "Tuesday": "Dienstag", diff --git a/src/i18n/strings/el.json b/src/i18n/strings/el.json index bc45e6da9e..048de7e73f 100644 --- a/src/i18n/strings/el.json +++ b/src/i18n/strings/el.json @@ -344,14 +344,8 @@ "This room": "Αυτό το δωμάτιο", "This room's internal ID is": "Το εσωτερικό αναγνωριστικό του δωματίου είναι", "times": "φορές", - "To ban users": "Για αποκλεισμό χρηστών", "to browse the directory": "για περιήγηση στο ευρετήριο", - "To configure the room": "Για ρύθμιση του δωματίου", - "To invite users into the room": "Για πρόσκληση χρηστών στο δωμάτιο", - "To remove other users' messages": "Για αφαίρεση μηνυμάτων άλλων χρηστών", "to restore": "για επαναφορά", - "To send events of type": "Για αποστολή συμβάντων τύπου", - "To send messages": "Για αποστολή μηνυμάτων", "Turn Markdown off": "Απενεργοποίηση Markdown", "Turn Markdown on": "Ενεργοποίηση Markdown", "Unable to add email address": "Αδυναμία προσθήκης διεύθυνσης ηλ. αλληλογραφίας", @@ -574,7 +568,6 @@ "Some of your messages have not been sent.": "Μερικά από τα μηνύματα σας δεν έχουν αποσταλεί.", "This room is not recognised.": "Αυτό το δωμάτιο δεν αναγνωρίζεται.", "to favourite": "στα αγαπημένα", - "To kick users": "Για να διώξετε χρήστες", "to make a room or": "για δημιουργία ενός δωματίου ή", "to start a chat with someone": "για να ξεκινήσετε μια συνομιλία με κάποιον", "Unable to capture screen": "Αδυναμία σύλληψης οθόνης", diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 87fd6d4364..8873b54091 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -448,21 +448,14 @@ "This room is not accessible by remote Matrix servers": "This room is not accessible by remote Matrix servers", "This room's internal ID is": "This room's internal ID is", "times": "times", - "To ban users": "To ban users", "to browse the directory": "to browse the directory", - "To configure the room": "To configure the room", "to demote": "to demote", "to favourite": "to favourite", "To get started, please pick a username!": "To get started, please pick a username!", - "To invite users into the room": "To invite users into the room", - "To kick users": "To kick users", "To link to a room it must have an address.": "To link to a room it must have an address.", "to make a room or": "to make a room or", - "To remove other users' messages": "To remove other users' messages", "To reset your password, enter the email address linked to your account": "To reset your password, enter the email address linked to your account", "to restore": "to restore", - "To send events of type": "To send events of type", - "To send messages": "To send messages", "to start a chat with someone": "to start a chat with someone", "to tag direct chat": "to tag direct chat", "To use it, just wait for autocomplete results to load and tab through them.": "To use it, just wait for autocomplete results to load and tab through them.", @@ -832,6 +825,13 @@ "Join an existing group": "Join an existing group", "To join an existing group you'll have to know its group identifier; this will look something like +example:matrix.org.": "To join an existing group you'll have to know its group identifier; this will look something like +example:matrix.org.", "Featured Rooms:": "Featured Rooms:", + "To send messages, you must be a": "To send messages, you must be a", + "To invite users into the room, you must be a": "To invite users into the room, you must be a", + "To configure the room, you must be a": "To configure the room, you must be a", + "To kick users, you must be a": "To kick users, you must be a", + "To ban users, you must be a": "To ban users, you must be a", + "To remove other users' messages, you must be a": "To remove other users' messages, you must be a", + "To send events of type , you must be a": "To send events of type , you must be a", "Error whilst fetching joined groups": "Error whilst fetching joined groups", "Featured Users:": "Featured Users:", "Edit Group": "Edit Group", diff --git a/src/i18n/strings/en_US.json b/src/i18n/strings/en_US.json index 928f1a9d0f..c3b3b6a1bc 100644 --- a/src/i18n/strings/en_US.json +++ b/src/i18n/strings/en_US.json @@ -393,21 +393,14 @@ "This room is not accessible by remote Matrix servers": "This room is not accessible by remote Matrix servers", "This room's internal ID is": "This room's internal ID is", "times": "times", - "To ban users": "To ban users", "to browse the directory": "to browse the directory", - "To configure the room": "To configure the room", "to demote": "to demote", "to favourite": "to favorite", - "To invite users into the room": "To invite users into the room", "to join the discussion": "to join the discussion", - "To kick users": "To kick users", "To link to a room it must have": "To link to a room it must have", "to make a room or": "to make a room or", - "To remove other users' messages": "To remove other users' messages", "To reset your password, enter the email address linked to your account": "To reset your password, enter the email address linked to your account", "to restore": "to restore", - "To send events of type": "To send events of type", - "To send messages": "To send messages", "to start a chat with someone": "to start a chat with someone", "to tag direct chat": "to tag direct chat", "To use it, just wait for autocomplete results to load and tab through them.": "To use it, just wait for autocomplete results to load and tab through them.", @@ -656,6 +649,13 @@ "Verify...": "Verify...", "ex. @bob:example.com": "ex. @bob:example.com", "Add User": "Add User", + "To send messages, you must be a": "To send messages, you must be a", + "To invite users into the room, you must be a": "To invite users into the room, you must be a", + "To configure the room, you must be a": "To configure the room, you must be a", + "To kick users, you must be a": "To kick users, you must be a", + "To ban users, you must be a": "To ban users, you must be a", + "To remove other users' messages, you must be a": "To remove other users' messages, you must be a", + "To send events of type , you must be a": "To send events of type , you must be a", "This Home Server would like to make sure you are not a robot": "This Home Server would like to make sure you are not a robot", "Sign in with CAS": "Sign in with CAS", "Custom Server Options": "Custom Server Options", diff --git a/src/i18n/strings/es.json b/src/i18n/strings/es.json index bc2391a5c7..9838b915a4 100644 --- a/src/i18n/strings/es.json +++ b/src/i18n/strings/es.json @@ -470,16 +470,11 @@ "This room is not accessible by remote Matrix servers": "Esta sala no es accesible por otros servidores Matrix", "This room's internal ID is": "El ID interno de la sala es", "times": "veces", - "To ban users": "Expulsar usuarios", "to browse the directory": "navegar el directorio", - "To configure the room": "Configurar la sala", "to demote": "degradar", "to favourite": "marcar como favorito", - "To invite users into the room": "Invitar usuarios a la sala", - "To kick users": "Patear usuarios", "To link to a room it must have an address.": "Para enlazar una sala, debe tener una dirección.", "to make a room or": "hacer una sala o", - "To remove other users' messages": "Eliminar los mensajes de otros usuarios", "To reset your password, enter the email address linked to your account": "Para reiniciar su contraseña, introduzca el e-mail asociado a su cuenta", "to restore": "restaurar", "Cancel": "Cancelar", @@ -505,8 +500,6 @@ "Authentication check failed: incorrect password?": "La verificación de la autentificación ha fallado: ¿El password es el correcto?", "And %(count)s more...": "Y %(count)s más...", "Press to start a chat with someone": "Pulsa para empezar a charlar con alguien", - "To send events of type": "Para enviar eventos de tipo", - "To send messages": "Para enviar mensajes", "to start a chat with someone": "para empezar a charlar con alguien", "to tag direct chat": "para etiquetar como charla directa", "Add a widget": "Añadir widget", diff --git a/src/i18n/strings/eu.json b/src/i18n/strings/eu.json index 9f3d06ec52..fb2ec9f7b7 100644 --- a/src/i18n/strings/eu.json +++ b/src/i18n/strings/eu.json @@ -464,20 +464,13 @@ "This room is not accessible by remote Matrix servers": "Gela hau ez dago eskuragarri urruneko zerbitzarietan", "This room's internal ID is": "Gela honen barne ID-a:", "times": "aldi", - "To ban users": "Erabiltzaileak debekatzea", "to browse the directory": "direktorioa arakatzea", - "To configure the room": "Gela konfiguratzea", "to demote": "mailaz jaistea", "to favourite": "gogoko egitea", - "To invite users into the room": "Erabiltzaileak gela honetara gonbidatzea", - "To kick users": "Erabiltzaileak kaleratzea", "To link to a room it must have an address.": "Gelara estekatzeko honek helbide bat izan behar du.", "to make a room or": "gela bat egitea edo", - "To remove other users' messages": "Beste erabiltzaileen mezuak kentzea", "To reset your password, enter the email address linked to your account": "Zure pasahitza berrezartzeko, sartu zure kontuarekin lotutako e-mail helbidea", "to restore": "berreskuratzea", - "To send events of type": "Mota honetako gertaerak bidaltzea:", - "To send messages": "Mezuak bidaltzea", "to start a chat with someone": "norbaitekin txat bat hastea", "to tag direct chat": "txat zuzena etiketatzea", "To use it, just wait for autocomplete results to load and tab through them.": "Erabiltzeko, itxaron osatze automatikoaren emaitzak kargatu arte eta gero tabuladorearekin hautatu.", diff --git a/src/i18n/strings/fr.json b/src/i18n/strings/fr.json index 585e47f5a3..8ab78d0436 100644 --- a/src/i18n/strings/fr.json +++ b/src/i18n/strings/fr.json @@ -354,21 +354,14 @@ "This room is not accessible by remote Matrix servers": "Ce salon n’est pas accessible par les serveurs Matrix distants", "This room's internal ID is": "L'identifiant interne de ce salon est", "times": "fois", - "To ban users": "Pour bannir des utilisateurs", "to browse the directory": "pour parcourir le répertoire", - "To configure the room": "Pour configurer le salon", "to demote": "pour réduire la priorité", "to favourite": "pour marquer comme favori", - "To invite users into the room": "Pour inviter des utilisateurs dans le salon", "to join the discussion": "pour rejoindre la discussion", - "To kick users": "Pour expulser des utilisateurs", "To link to a room it must have": "Pour avoir un lien vers un salon, il doit avoir", "to make a room or": "pour créer un salon ou", - "To remove other users' messages": "Pour supprimer les messages des autres utilisateurs", "To reset your password, enter the email address linked to your account": "Pour réinitialiser votre mot de passe, merci d’entrer l’adresse e-mail liée à votre compte", "to restore": "pour restaurer", - "To send events of type": "Pour envoyer des évènements du type", - "To send messages": "Pour envoyer des messages", "to start a chat with someone": "pour démarrer une discussion avec quelqu’un", "to tag direct chat": "pour marquer comme conversation directe", "To use it, just wait for autocomplete results to load and tab through them.": "Pour l’utiliser, attendez simplement que les résultats de l’auto-complétion s’affichent et défilez avec la touche Tab.", diff --git a/src/i18n/strings/hu.json b/src/i18n/strings/hu.json index 2c34e05b1a..fb295535ca 100644 --- a/src/i18n/strings/hu.json +++ b/src/i18n/strings/hu.json @@ -432,19 +432,12 @@ "This room is not accessible by remote Matrix servers": "Ez a szoba távoli Matrix szerverről nem érhető el", "This room's internal ID is": "A szoba belső azonosítója:", "times": "alkalommal", - "To ban users": "Felhasználó kizárásához", "to browse the directory": "a könyvtárban való kereséshez", - "To configure the room": "A szoba beállításához", "to favourite": "kedvencekhez", - "To invite users into the room": "Felhasználó szobába való meghívásához", - "To kick users": "Felhasználó kirúgásához", "To link to a room it must have an address.": "Szobához való kötéshez szükséges egy cím.", "to make a room or": "szoba létrehozásához vagy", - "To remove other users' messages": "Más felhasználók üzeneteinek törléséhez", "To reset your password, enter the email address linked to your account": "A jelszó alaphelyzetbe állításához add meg a fiókodhoz kötött e-mail címet", "to restore": "visszaállításhoz", - "To send events of type": "Az alábbi típusú üzenetek küldéséhez", - "To send messages": "Üzenetek küldéséhez", "to start a chat with someone": "csevegés indításához valakivel", "to tag direct chat": "megjelölni közvetlen csevegésnek", "To use it, just wait for autocomplete results to load and tab through them.": "A használatához csak várd meg az automatikus kiegészítéshez a találatok betöltését és TAB-bal választhatsz közülük.", diff --git a/src/i18n/strings/ko.json b/src/i18n/strings/ko.json index 8b6e233437..96655ccf4f 100644 --- a/src/i18n/strings/ko.json +++ b/src/i18n/strings/ko.json @@ -434,20 +434,13 @@ "This room is not accessible by remote Matrix servers": "이 방은 원격 매트릭스 서버에 접근할 수 없어요", "This room's internal ID is": "방의 내부 ID", "times": "번", - "To ban users": "사용자를 차단하기", "to browse the directory": "목록에서 찾으려면", - "To configure the room": "방을 구성하기", "to demote": "우선순위 낮추기", "to favourite": "즐겨찾기", - "To invite users into the room": "방으로 사용자를 초대하기", - "To kick users": "사용자를 내쫓기", "To link to a room it must have an address.": "방에 연결하려면 주소가 있어야 해요.", "to make a room or": "방을 만들거나 혹은", - "To remove other users' messages": "다른 사용자의 메시지를 지우기", "To reset your password, enter the email address linked to your account": "비밀번호을 다시 설정하려면, 계정과 연결한 이메일 주소를 입력해주세요", "to restore": "복구하려면", - "To send events of type": "유형 이벤트 보내기", - "To send messages": "메시지 보내기", "to start a chat with someone": "다른 사람과 이야기하기", "to tag direct chat": "직접 이야기를 지정하려면", "To use it, just wait for autocomplete results to load and tab through them.": "이 기능을 사용하시려면, 자동완성 결과가 나오길 기다리신 뒤에 탭으로 움직여주세요.", diff --git a/src/i18n/strings/lv.json b/src/i18n/strings/lv.json index 5f58fd9515..fea8065a5f 100644 --- a/src/i18n/strings/lv.json +++ b/src/i18n/strings/lv.json @@ -502,20 +502,13 @@ "This room is not accessible by remote Matrix servers": "Šī istaba nav pieejama no attālinātajiem Matrix serveriem", "This room's internal ID is": "Šīs istabas iekšējais ID ir", "times": "reizes", - "To ban users": "lai banotu lietotājus", "to browse the directory": "lai pārlūkotu katalogu", - "To configure the room": "Lai konfigurētu istabu", "to demote": "lai samazinātu", "to favourite": "lai pievienotu favorītiem", - "To invite users into the room": "Lai uzaicinātu lietotājus uz istabu", - "To kick users": "Lai \"iespertu\" (kicks) lietotājiem", "To link to a room it must have an address.": "Lai ieliktu saiti uz istabu, tai ir jābūt piešķirtai adresei.", "to make a room or": "lai izveidotu istabu vai", - "To remove other users' messages": "Lai dzēstu citu lietotāju ziņas", "To reset your password, enter the email address linked to your account": "Lai atiestatītu savu paroli, ievadi tavam kontam piesaistīto epasta adresi", "to restore": "lai atjaunotu", - "To send events of type": "Lai sūtītu sekojošā tipa notikumus", - "To send messages": "Lai nosūtītu ziņas", "to start a chat with someone": "lai uzstāktu čatu ar kādu", "to tag direct chat": "lai pieliktu birku tiešajam čatam", "To use it, just wait for autocomplete results to load and tab through them.": "Lai to izmantotu, vienkārši gaidi, kamēr ielādējas automātiski ieteiktie rezultāti, un pārvietojies caur tiem.", diff --git a/src/i18n/strings/nl.json b/src/i18n/strings/nl.json index f770e335cf..10f7f4900e 100644 --- a/src/i18n/strings/nl.json +++ b/src/i18n/strings/nl.json @@ -459,20 +459,13 @@ "This room is not accessible by remote Matrix servers": "Deze ruimte is niet toegankelijk voor afgelegen Matrix-servers", "This room's internal ID is": "Het interne ID van deze ruimte is", "times": "keer", - "To ban users": "om gebruikers te verbannen", "to browse the directory": "om de catalogus door te bladeren", - "To configure the room": "Om de ruimte te configureren", "to demote": "om te degraderen", "to favourite": "om aan favorieten toe te voegen", - "To invite users into the room": "Om gebruikers in deze ruimte toe te voegen", - "To kick users": "Om gebruikers er uit te zetten", "To link to a room it must have an address.": "Om naar een ruimte te linken moet het een adres hebben.", "to make a room or": "om een ruimte te maken of", - "To remove other users' messages": "Om berichten van anderen gebruikers te verwijderen", "To reset your password, enter the email address linked to your account": "Voer het e-mailadres dat met je account verbonden is in om je wachtwoord opnieuw in te stellen", "to restore": "om te herstellen", - "To send events of type": "Om een bepaalde soort gebeurtenissen te sturen", - "To send messages": "Om berichten te versturen", "to start a chat with someone": "om een gesprek met iemand te starten", "to tag direct chat": "als directe chat etiketteren", "To use it, just wait for autocomplete results to load and tab through them.": "Om het te gebruiken, wacht tot de automatisch aangevulde resultaten geladen zijn en tab er doorheen.", diff --git a/src/i18n/strings/pl.json b/src/i18n/strings/pl.json index bd1e4c5c24..0805c8fb66 100644 --- a/src/i18n/strings/pl.json +++ b/src/i18n/strings/pl.json @@ -515,20 +515,13 @@ "This room is not accessible by remote Matrix servers": "Ten pokój nie jest dostępny na zdalnych serwerach Matrix", "This room's internal ID is": "Wewnętrzne ID tego pokoju to", "times": "razy", - "To ban users": "Żeby zablokować użytkowników", "to browse the directory": "żeby przeglądać katalog", - "To configure the room": "Żeby skonfigurować pokój", "to demote": "żeby zmniejszyć priorytet", "To get started, please pick a username!": "Aby rozpocząć, wybierz nazwę użytkownika!", - "To invite users into the room": "Żeby zaprosić użytkowników do pokoju", - "To kick users": "Żeby usuwać użytkowników", "to make a room or": "żeby utworzyć pokój lub", - "To remove other users' messages": "Żeby usuwać wiadomości innych użytkowników", "To reset your password, enter the email address linked to your account": "Aby zresetować swoje hasło, wpisz adres e-mail powiązany z twoim kontem", "to restore": "żeby przywrócić", - "To send messages": "Żeby wysyłać wiadomości", "to start a chat with someone": "żeby zacząć rozmowę z kimś", - "To send events of type": "Żeby wysyłać wydarzenia typu", "to tag direct chat": "żeby oznaczyć rozmowę bezpośrednią", "Turn Markdown off": "Wyłącz Markdown", "Turn Markdown on": "Włącz Markdown", diff --git a/src/i18n/strings/pt.json b/src/i18n/strings/pt.json index ba4968b7ad..a1e4cce4e9 100644 --- a/src/i18n/strings/pt.json +++ b/src/i18n/strings/pt.json @@ -215,16 +215,10 @@ "This room is not accessible by remote Matrix servers": "Esta sala não é acessível para servidores Matrix remotos", "This room's internal ID is": "O ID interno desta sala é", "times": "vezes", - "To ban users": "Para banir usuárias/os", - "To configure the room": "Para poder configurar a sala", - "To invite users into the room": "Para convidar usuárias/os para esta sala", "to join the discussion": "para se juntar à conversa", - "To kick users": "Para poder remover pessoas da sala", "To link to a room it must have": "Para fazer um link para uma sala, ela deve ter", "To redact messages": "Para poder apagar mensagens", "To reset your password, enter the email address linked to your account": "Para redefinir sua senha, entre com o email da sua conta", - "To send events of type": "Para enviar eventos do tipo", - "To send messages": "Para enviar mensagens", "turned on end-to-end encryption (algorithm": "acionou a encriptação ponta-a-ponta (algoritmo", "Unable to add email address": "Não foi possível adicionar endereço de email", "Unable to remove contact information": "Não foi possível remover informação de contato", @@ -365,7 +359,6 @@ "to demote": "para reduzir prioridade", "to favourite": "para favoritar", "to make a room or": "para criar uma sala ou", - "To remove other users' messages": "Para apagar mensagens de outras pessoas", "to restore": "para restaurar", "to start a chat with someone": "para iniciar uma conversa com alguém", "to tag direct chat": "para marcar a conversa como pessoal", diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index af4804bd85..0cefe77aa6 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -215,16 +215,10 @@ "This room is not accessible by remote Matrix servers": "Esta sala não é acessível para servidores Matrix remotos", "This room's internal ID is": "O ID interno desta sala é", "times": "vezes", - "To ban users": "Para banir usuárias/os", - "To configure the room": "Para poder configurar a sala", - "To invite users into the room": "Para convidar usuárias/os para esta sala", "to join the discussion": "para se juntar à conversa", - "To kick users": "Para poder remover pessoas da sala", "To link to a room it must have": "Para fazer um link para uma sala, ela deve ter", "To redact messages": "Para poder apagar mensagens", "To reset your password, enter the email address linked to your account": "Para redefinir sua senha, entre com o email da sua conta", - "To send events of type": "Para enviar eventos do tipo", - "To send messages": "Para enviar mensagens", "turned on end-to-end encryption (algorithm": "acionou a encriptação ponta-a-ponta (algoritmo", "Unable to add email address": "Não foi possível adicionar endereço de email", "Unable to remove contact information": "Não foi possível remover informação de contato", @@ -364,7 +358,6 @@ "to demote": "para reduzir prioridade", "to favourite": "para favoritar", "to make a room or": "para criar uma sala ou", - "To remove other users' messages": "Para apagar mensagens de outras pessoas", "to restore": "para restaurar", "to start a chat with someone": "para iniciar uma conversa com alguém", "to tag direct chat": "para marcar a conversa como pessoal", diff --git a/src/i18n/strings/ru.json b/src/i18n/strings/ru.json index cfab960e32..3ff06070c3 100644 --- a/src/i18n/strings/ru.json +++ b/src/i18n/strings/ru.json @@ -155,8 +155,6 @@ "Start Chat": "Начать чат", "tag as": "tag as", "These are experimental features that may break in unexpected ways. Use with caution": "These are experimental features that may break in unexpected ways. Use with caution", - "To send events of type": "Чтобы отправить тип события", - "To send messages": "Чтобы отправить сообщения", "turned on end-to-end encryption (algorithm": "turned on end-to-end encryption (algorithm", "Unable to add email address": "Не удается добавить адрес электронной почты", "Unable to remove contact information": "Не удалось удалить контактную информацию", @@ -596,15 +594,10 @@ "The visibility of existing history will be unchanged": "Видимость существующей истории не изменится", "this invitation?": "это приглашение?", "This room is not accessible by remote Matrix servers": "Это комната недоступна с удаленных серверов Matrix", - "To ban users": "Для блокировки пользователей", "to browse the directory": "для просмотра каталога", - "To configure the room": "Для настройки комнаты", - "To invite users into the room": "Чтобы приглашать пользователей в комнату", "to join the discussion": "присоединиться к дискуссии", - "To kick users": "Чтобы удалять пользователей", "To link to a room it must have": "Для создания ссылки на комнату она должна иметь", "to make a room or": "чтобы создать комнату или", - "To remove other users' messages": "Чтобы удалить сообщения других пользователей", "To reset your password, enter the email address linked to your account": "Чтобы сбросить пароль, введите адрес электронной почты, связанный с вашей учетной записью", "Tried to load a specific point in this room's timeline, but you do not have permission to view the message in question.": "Попытка загрузить выбранный интервал истории чата этой комнаты не удалась, так как у вас нет разрешений на просмотр.", "Tried to load a specific point in this room's timeline, but was unable to find it.": "Попытка загрузить выбранный интервал истории чата этой комнаты не удалась, так как запрошенный элемент не найден.", diff --git a/src/i18n/strings/th.json b/src/i18n/strings/th.json index d45cb86986..9ff6e5b151 100644 --- a/src/i18n/strings/th.json +++ b/src/i18n/strings/th.json @@ -323,7 +323,6 @@ "The phone number entered looks invalid": "ดูเหมือนว่าหมายเลขโทรศัพท์ที่กรอกรมาไม่ถูกต้อง", "The email address linked to your account must be entered.": "กรุณากรอกที่อยู่อีเมลที่เชื่อมกับบัญชีของคุณ", "The file '%(fileName)s' exceeds this home server's size limit for uploads": "ไฟล์ '%(fileName)s' มีขนาดใหญ่เกินจำกัดของเซิร์ฟเวอร์บ้าน", - "To send messages": "เพื่อส่งข้อความ", "to start a chat with someone": "เพื่อเริ่มแชทกับผู้อื่น", "to tag direct chat": "เพื่อแทกว่าแชทตรง", "Turn Markdown off": "ปิด markdown", @@ -488,13 +487,8 @@ "Otherwise, click here to send a bug report.": "หรือคลิกที่นี่เพื่อรายงานจุดบกพร่อง", "Power level must be positive integer.": "ระดับอำนาจต้องเป็นจำนวนเต็มบวก", "%(roomName)s does not exist.": "ไม่มีห้อง %(roomName)s อยู่จริง", - "To ban users": "จะแบนผู้ใช้ได้", - "To configure the room": "จะตั้งค่าห้องนี้ได้", "to browse the directory": "เพื่อเรียกดูไดเรกทอรี", - "To invite users into the room": "จะเชิญผู้ใช้เข้าห้องได้", - "To kick users": "จะเตะผู้ใช้ได้", "To link to a room it must have an address.": "ห้องต้องมีที่อยู่ก่อน ถึงจะลิงก์ได้", - "To remove other users' messages": "จะลบข้อความของผู้ใช้อื่นได้", "Enter passphrase": "กรอกรหัสผ่าน", "Seen by %(userName)s at %(dateTime)s": "%(userName)s เห็นแล้วเมื่อเวลา %(dateTime)s", "to restore": "เพื่อกู้คืน", diff --git a/src/i18n/strings/tr.json b/src/i18n/strings/tr.json index 23d4e284bc..5c1017d177 100644 --- a/src/i18n/strings/tr.json +++ b/src/i18n/strings/tr.json @@ -415,20 +415,13 @@ "This room is not accessible by remote Matrix servers": "Bu oda uzak Matrix Sunucuları tarafından erişilebilir değil", "This room's internal ID is": "Bu odanın Dahili ID'si", "times": "kere", - "To ban users": "Kullanıcıları yasaklamak(Ban) için", "to browse the directory": "Dizine göz atmak için", - "To configure the room": "Odayı yapılandırmak için", "to demote": "indirgemek için", "to favourite": "favorilemek", - "To invite users into the room": "Kullanıcıları odaya davet etmek", - "To kick users": "Kullanıcıları atmak", "To link to a room it must have an address.": "Bir odaya bağlanmak için oda bir adrese sahip olmalı.", "to make a room or": "bir oda oluşturmak için ya da", - "To remove other users' messages": "Diğer kullanıcıların mesajlarını silmek için", "To reset your password, enter the email address linked to your account": "Parolanızı sıfırlamak için hesabınıza bağlı e-posta adresinizi girin", "to restore": "yenilemek için", - "To send events of type": "Tip olayını göndermek için", - "To send messages": "Mesaj göndermek için", "to start a chat with someone": "birisiyle sohbet başlatmak için", "to tag direct chat": "doğrudan sohbeti etiketlemek için", "To use it, just wait for autocomplete results to load and tab through them.": "Kullanmak için , otomatik tamamlama sonuçlarının yüklenmesini ve bitmesini bekleyin.", diff --git a/src/i18n/strings/zh_Hant.json b/src/i18n/strings/zh_Hant.json index 596bc55a01..cad8834052 100644 --- a/src/i18n/strings/zh_Hant.json +++ b/src/i18n/strings/zh_Hant.json @@ -483,20 +483,13 @@ "This room is not accessible by remote Matrix servers": "此房間無法被遠端的 Matrix 伺服器存取", "This room's internal ID is": "此房間的內部 ID 為", "times": "次數", - "To ban users": "要禁止使用者", "to browse the directory": "要瀏覽目錄", - "To configure the room": "要設定房間", "to demote": "要降級", "to favourite": "到喜歡", - "To invite users into the room": "要邀請使用者進入此房間", - "To kick users": "要踢出使用者", "To link to a room it must have an address.": "要連結到房間,它必須有地址。", "to make a room or": "要開房間或", - "To remove other users' messages": "要移除其他使用者的訊息", "To reset your password, enter the email address linked to your account": "要重設您的密碼,輸入連結到您的帳號的電子郵件地址", "to restore": "要復原", - "To send events of type": "要傳送活動類型", - "To send messages": "要傳送訊息", "to start a chat with someone": "要開始與某人聊天", "to tag direct chat": "要標記直接聊天", "To use it, just wait for autocomplete results to load and tab through them.": "要使用它,只要等待自動完成的結果載入並在它們上面按 Tab。", From 614cf950b63fc64a15f51bf1324eb99bc764eda9 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 29 Sep 2017 14:45:00 -0600 Subject: [PATCH 3/7] Supply user-friendly labels for common events Signed-off-by: Travis Ralston --- src/components/views/rooms/RoomSettings.js | 15 ++++++++++++++- src/i18n/strings/en_EN.json | 5 +++++ src/i18n/strings/en_US.json | 5 +++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 942da9ba06..412f67fc23 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -35,6 +35,16 @@ function parseIntWithDefault(val, def) { return isNaN(res) ? def : res; } +const plEventsToLabels = { + // These will be translated for us later. + // TODO: _td() these when https://github.com/matrix-org/matrix-react-sdk/pull/1421 lands + "m.room.avatar": "To change the room's avatar, you must be a", + "m.room.name": "To change the room's name, you must be a", + "m.room.canonical_alias": "To change the room's main address, you must be a", + "m.room.history_visibility": "To change the room's history visibility, you must be a", + "m.room.power_levels": "To change the permissions in the room, you must be a", +}; + const BannedUser = React.createClass({ propTypes: { canUnban: React.PropTypes.bool, @@ -885,9 +895,12 @@ module.exports = React.createClass({ {Object.keys(events_levels).map(function(event_type, i) { + let label = plEventsToLabels[event_type]; + if (label) label = _t(label); + else label = _tJsx("To send events of type , you must be a", //, () => { event_type }); return (
- { _tJsx("To send events of type , you must be a", //, () => { event_type }) } + { label }
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 8873b54091..6309e60e82 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -832,6 +832,11 @@ "To ban users, you must be a": "To ban users, you must be a", "To remove other users' messages, you must be a": "To remove other users' messages, you must be a", "To send events of type , you must be a": "To send events of type , you must be a", + "To change the room's avatar, you must be a": "To change the room's avatar, you must be a", + "To change the room's name, you must be a": "To change the room's name, you must be a", + "To change the room's main address, you must be a": "To change the room's main address, you must be a", + "To change the room's history visibility, you must be a": "To change the room's history visibility, you must be a", + "To change the permissions in the room, you must be a": "To change the permissions in the room, you must be a", "Error whilst fetching joined groups": "Error whilst fetching joined groups", "Featured Users:": "Featured Users:", "Edit Group": "Edit Group", diff --git a/src/i18n/strings/en_US.json b/src/i18n/strings/en_US.json index c3b3b6a1bc..7f99f7789c 100644 --- a/src/i18n/strings/en_US.json +++ b/src/i18n/strings/en_US.json @@ -656,6 +656,11 @@ "To ban users, you must be a": "To ban users, you must be a", "To remove other users' messages, you must be a": "To remove other users' messages, you must be a", "To send events of type , you must be a": "To send events of type , you must be a", + "To change the room's avatar, you must be a": "To change the room's avatar, you must be a", + "To change the room's name, you must be a": "To change the room's name, you must be a", + "To change the room's main address, you must be a": "To change the room's main address, you must be a", + "To change the room's history visibility, you must be a": "To change the room's history visibility, you must be a", + "To change the permissions in the room, you must be a": "To change the permissions in the room, you must be a", "This Home Server would like to make sure you are not a robot": "This Home Server would like to make sure you are not a robot", "Sign in with CAS": "Sign in with CAS", "Custom Server Options": "Custom Server Options", From 8ab3d94c1ce3b972a77da331d910189256503996 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 29 Sep 2017 15:11:48 -0600 Subject: [PATCH 4/7] Always show common events in the PL section of room settings Signed-off-by: Travis Ralston --- src/components/views/rooms/RoomSettings.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 412f67fc23..59b05dc4ac 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -45,6 +45,15 @@ const plEventsToLabels = { "m.room.power_levels": "To change the permissions in the room, you must be a", }; +const plEventsToShow = { + // If an event is listed here, it will be shown in the PL settings. Defaults will be calculated. + "m.room.avatar": {isState: true}, + "m.room.name": {isState: true}, + "m.room.canonical_alias": {isState: true}, + "m.room.history_visibility": {isState: true}, + "m.room.power_levels": {isState: true}, +} + const BannedUser = React.createClass({ propTypes: { canUnban: React.PropTypes.bool, @@ -556,6 +565,14 @@ module.exports = React.createClass({ this.forceUpdate(); }, + _populateDefaultPlEvents: function(eventsSection, stateLevel, eventsLevel) { + for (let desiredEvent of Object.keys(plEventsToShow)) { + if (!(desiredEvent in eventsSection)) { + eventsSection[desiredEvent] = (plEventsToShow[desiredEvent].isState ? stateLevel : eventsLevel); + } + } + }, + _renderEncryptionSection: function() { var cli = MatrixClientPeg.get(); var roomState = this.props.room.currentState; @@ -626,6 +643,8 @@ module.exports = React.createClass({ var state_level = power_level_event ? parseIntWithDefault(power_levels.state_default, 50) : 0; var default_user_level = parseIntWithDefault(power_levels.users_default, 0); + this._populateDefaultPlEvents(events_levels, state_level, send_level); + var current_user_level = user_levels[user_id]; if (current_user_level === undefined) { current_user_level = default_user_level; From 8ee9d39ffa19adb7182d8e61a9831bf2975cea52 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 29 Sep 2017 15:12:05 -0600 Subject: [PATCH 5/7] Expose option for m.room.topic power level Signed-off-by: Travis Ralston --- src/components/views/rooms/RoomSettings.js | 2 ++ src/i18n/strings/en_EN.json | 1 + src/i18n/strings/en_US.json | 1 + 3 files changed, 4 insertions(+) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 59b05dc4ac..f1dcfbfc64 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -43,6 +43,7 @@ const plEventsToLabels = { "m.room.canonical_alias": "To change the room's main address, you must be a", "m.room.history_visibility": "To change the room's history visibility, you must be a", "m.room.power_levels": "To change the permissions in the room, you must be a", + "m.room.topic": "To change the topic, you must be a", }; const plEventsToShow = { @@ -52,6 +53,7 @@ const plEventsToShow = { "m.room.canonical_alias": {isState: true}, "m.room.history_visibility": {isState: true}, "m.room.power_levels": {isState: true}, + "m.room.topic": {isState: true}, } const BannedUser = React.createClass({ diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 6309e60e82..ee1bed814a 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -837,6 +837,7 @@ "To change the room's main address, you must be a": "To change the room's main address, you must be a", "To change the room's history visibility, you must be a": "To change the room's history visibility, you must be a", "To change the permissions in the room, you must be a": "To change the permissions in the room, you must be a", + "To change the topic, you must be a": "To change the topic, you must be a", "Error whilst fetching joined groups": "Error whilst fetching joined groups", "Featured Users:": "Featured Users:", "Edit Group": "Edit Group", diff --git a/src/i18n/strings/en_US.json b/src/i18n/strings/en_US.json index 7f99f7789c..a1dd9d53cc 100644 --- a/src/i18n/strings/en_US.json +++ b/src/i18n/strings/en_US.json @@ -661,6 +661,7 @@ "To change the room's main address, you must be a": "To change the room's main address, you must be a", "To change the room's history visibility, you must be a": "To change the room's history visibility, you must be a", "To change the permissions in the room, you must be a": "To change the permissions in the room, you must be a", + "To change the topic, you must be a": "To change the topic, you must be a", "This Home Server would like to make sure you are not a robot": "This Home Server would like to make sure you are not a robot", "Sign in with CAS": "Sign in with CAS", "Custom Server Options": "Custom Server Options", From 20798dd2fa161d4e24229ef0f8fbf33e3ac08e06 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 29 Sep 2017 15:22:37 -0600 Subject: [PATCH 6/7] Expose power level setting for widgets Fixes https://github.com/vector-im/riot-web/issues/4866 Signed-off-by: Travis Ralston --- src/components/views/rooms/RoomSettings.js | 4 ++++ src/i18n/strings/en_EN.json | 1 + src/i18n/strings/en_US.json | 1 + 3 files changed, 6 insertions(+) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index f1dcfbfc64..e3fe50713b 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -44,6 +44,8 @@ const plEventsToLabels = { "m.room.history_visibility": "To change the room's history visibility, you must be a", "m.room.power_levels": "To change the permissions in the room, you must be a", "m.room.topic": "To change the topic, you must be a", + + "im.vector.modular.widgets": "To modify widgets in the room, you must be a", }; const plEventsToShow = { @@ -54,6 +56,8 @@ const plEventsToShow = { "m.room.history_visibility": {isState: true}, "m.room.power_levels": {isState: true}, "m.room.topic": {isState: true}, + + "im.vector.modular.widgets": {isState: true}, } const BannedUser = React.createClass({ diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index ee1bed814a..792626ca7c 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -838,6 +838,7 @@ "To change the room's history visibility, you must be a": "To change the room's history visibility, you must be a", "To change the permissions in the room, you must be a": "To change the permissions in the room, you must be a", "To change the topic, you must be a": "To change the topic, you must be a", + "To modify widgets in the room, you must be a": "To modify widgets in the room, you must be a", "Error whilst fetching joined groups": "Error whilst fetching joined groups", "Featured Users:": "Featured Users:", "Edit Group": "Edit Group", diff --git a/src/i18n/strings/en_US.json b/src/i18n/strings/en_US.json index a1dd9d53cc..8a78a18407 100644 --- a/src/i18n/strings/en_US.json +++ b/src/i18n/strings/en_US.json @@ -662,6 +662,7 @@ "To change the room's history visibility, you must be a": "To change the room's history visibility, you must be a", "To change the permissions in the room, you must be a": "To change the permissions in the room, you must be a", "To change the topic, you must be a": "To change the topic, you must be a", + "To modify widgets in the room, you must be a": "To modify widgets in the room, you must be a", "This Home Server would like to make sure you are not a robot": "This Home Server would like to make sure you are not a robot", "Sign in with CAS": "Sign in with CAS", "Custom Server Options": "Custom Server Options", From 0ab5b1a6af3598c52102bcea24029244c398e54d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 11 Oct 2017 08:50:28 -0600 Subject: [PATCH 7/7] _td translatable strings Signed-off-by: Travis Ralston --- src/components/views/rooms/RoomSettings.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index b3b27875a0..e6d3bc7d71 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -17,7 +17,7 @@ limitations under the License. import Promise from 'bluebird'; import React from 'react'; -import { _t, _tJsx } from '../../../languageHandler'; +import { _t, _tJsx, _td } from '../../../languageHandler'; import MatrixClientPeg from '../../../MatrixClientPeg'; import SdkConfig from '../../../SdkConfig'; import sdk from '../../../index'; @@ -37,15 +37,14 @@ function parseIntWithDefault(val, def) { const plEventsToLabels = { // These will be translated for us later. - // TODO: _td() these when https://github.com/matrix-org/matrix-react-sdk/pull/1421 lands - "m.room.avatar": "To change the room's avatar, you must be a", - "m.room.name": "To change the room's name, you must be a", - "m.room.canonical_alias": "To change the room's main address, you must be a", - "m.room.history_visibility": "To change the room's history visibility, you must be a", - "m.room.power_levels": "To change the permissions in the room, you must be a", - "m.room.topic": "To change the topic, you must be a", + "m.room.avatar": _td("To change the room's avatar, you must be a"), + "m.room.name": _td("To change the room's name, you must be a"), + "m.room.canonical_alias": _td("To change the room's main address, you must be a"), + "m.room.history_visibility": _td("To change the room's history visibility, you must be a"), + "m.room.power_levels": _td("To change the permissions in the room, you must be a"), + "m.room.topic": _td("To change the topic, you must be a"), - "im.vector.modular.widgets": "To modify widgets in the room, you must be a", + "im.vector.modular.widgets": _td("To modify widgets in the room, you must be a"), }; const plEventsToShow = {