From 9124c1475aecbe6dd6713e3ec5e2c80c5528c3c9 Mon Sep 17 00:00:00 2001 From: turt2live Date: Mon, 24 Apr 2017 12:48:32 -0600 Subject: [PATCH 1/9] Change redact -> remove to improve clarity Addresses #2814 Non-technical users may not understand what 'redact' means and can more easily understand what 'Remove' does. See discussion on vector-im/riot-web#2814 for more information. Signed-off-by: Travis Ralston --- src/components/views/context_menus/MessageContextMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index db416b8a06..5a7356a11c 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -129,7 +129,7 @@ module.exports = React.createClass({ if (!eventStatus && !this.props.mxEvent.isRedacted()) { // sent and not redacted redactButton = (
- Redact + Remove
); } From aff1e14efc70ab5c2bc86d4d724c604d63806d6b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 16 May 2017 13:15:14 +0100 Subject: [PATCH 2/9] first go at show redact only if we can redact Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/context_menus/MessageContextMenu.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index db416b8a06..0f750c10a5 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -25,6 +25,11 @@ var Modal = require('matrix-react-sdk/lib/Modal'); var Resend = require("matrix-react-sdk/lib/Resend"); import * as UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore'; +function parseIntWithDefault(val, def) { + var res = parseInt(val); + return isNaN(res) ? def : res; +} + module.exports = React.createClass({ displayName: 'MessageContextMenu', @@ -126,7 +131,19 @@ module.exports = React.createClass({ ); } - if (!eventStatus && !this.props.mxEvent.isRedacted()) { // sent and not redacted + const cli = MatrixClientPeg.get(); + + const room = cli.getRoom(this.props.mxEvent.getRoomId()); + const powerLevelEvents = room.currentState.getStateEvents('m.room.power_levels', ''); + const powerLevels = powerLevelEvents ? powerLevelEvents.getContent() : {}; + const userLevels = powerLevels.users || {}; + + const userLevel = userLevels[cli.credentials.userId] || parseIntWithDefault(powerLevels.users_default, 0); + + if (!eventStatus && !this.props.mxEvent.isRedacted() && (// sent and not redacted + this.props.mxEvent.getSender() === cli.credentials.userId // own event + || userLevel >= parseIntWithDefault(powerLevels.redact, 50) // has PL to redact + )) { redactButton = (
Redact From d55f4f9e6a3e3a3e1230d97132b22c9ea1aa14c6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 16 May 2017 14:08:00 +0100 Subject: [PATCH 3/9] use new RoomState method from matrix-org/matrix-js-sdk/pull/435 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/context_menus/MessageContextMenu.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 0f750c10a5..1fab91dde2 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -132,18 +132,9 @@ module.exports = React.createClass({ } const cli = MatrixClientPeg.get(); - const room = cli.getRoom(this.props.mxEvent.getRoomId()); - const powerLevelEvents = room.currentState.getStateEvents('m.room.power_levels', ''); - const powerLevels = powerLevelEvents ? powerLevelEvents.getContent() : {}; - const userLevels = powerLevels.users || {}; - const userLevel = userLevels[cli.credentials.userId] || parseIntWithDefault(powerLevels.users_default, 0); - - if (!eventStatus && !this.props.mxEvent.isRedacted() && (// sent and not redacted - this.props.mxEvent.getSender() === cli.credentials.userId // own event - || userLevel >= parseIntWithDefault(powerLevels.redact, 50) // has PL to redact - )) { + if (!eventStatus && room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId)) { redactButton = (
Redact From db78534b45fff22219a07128d600093dfef7b4b9 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 16 May 2017 14:10:00 +0100 Subject: [PATCH 4/9] remove no longer required parseIntWithDefault Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/context_menus/MessageContextMenu.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 1fab91dde2..d200f5aedf 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -25,11 +25,6 @@ var Modal = require('matrix-react-sdk/lib/Modal'); var Resend = require("matrix-react-sdk/lib/Resend"); import * as UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore'; -function parseIntWithDefault(val, def) { - var res = parseInt(val); - return isNaN(res) ? def : res; -} - module.exports = React.createClass({ displayName: 'MessageContextMenu', From 58ada2c27d2d0d3f307545169fff2b317fee0399 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 16 May 2017 14:14:06 +0100 Subject: [PATCH 5/9] move mxEvent.status check to js-sdk Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/context_menus/MessageContextMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index d200f5aedf..86c1d74a61 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -129,7 +129,7 @@ module.exports = React.createClass({ const cli = MatrixClientPeg.get(); const room = cli.getRoom(this.props.mxEvent.getRoomId()); - if (!eventStatus && room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId)) { + if (room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId)) { redactButton = (
Redact From ab9ecc4f6428afb27d2af746ddf0f59bce868c23 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 28 May 2017 21:35:47 +0100 Subject: [PATCH 6/9] remove duplicate i18n keys --- src/i18n/strings/pt.json | 1 - src/i18n/strings/pt_BR.json | 1 - src/i18n/strings/ru.json | 1 - 3 files changed, 3 deletions(-) diff --git a/src/i18n/strings/pt.json b/src/i18n/strings/pt.json index 44041bc8fc..d55488059c 100644 --- a/src/i18n/strings/pt.json +++ b/src/i18n/strings/pt.json @@ -2,7 +2,6 @@ "Add an email address above to configure email notifications": "Adicione um endereço de email acima para configurar as notificações por email", "All messages": "Todas as mensagens", "All messages (loud)": "Todas as mensagens (alto)", - "All notifications are currently disabled for all targets.": "Todas as notificações estão atualmente desativadas para todos os destinos", "An error occurred whilst saving your email notification preferences.": "Um erro ocorreu enquanto salvava suas preferências de notificação por email.", "Cancel Sending": "Cancelar o envio", "Can't update user notification settings": "Não é possível atualizar as preferências de notificação", diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index 545ed11a3d..f535bf0e4e 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -2,7 +2,6 @@ "Add an email address above to configure email notifications": "Insira um endereço de email no campo acima para configurar suas notificações por email", "All messages": "Todas as mensagens", "All messages (loud)": "Todas as mensagens (alto)", - "All notifications are currently disabled for all targets.": "Todas as notificações estão atualmente desativadas para todos os destinos", "An error occurred whilst saving your email notification preferences.": "Um erro ocorreu enquanto o sistema estava salvando suas preferências de notificação por email.", "Call invitation": "Convite para chamada", "Cancel Sending": "Cancelar o envio", diff --git a/src/i18n/strings/ru.json b/src/i18n/strings/ru.json index fe5196ae3f..465a3573f9 100644 --- a/src/i18n/strings/ru.json +++ b/src/i18n/strings/ru.json @@ -119,7 +119,6 @@ "Advanced notification settings": "Настройки уведомлений", "Call invitation": "Звонок", "customServer_text": "Вы можете войти с помощью вашего сервера.
Это позволяет вам использовать Riot с уже существующей учетной записью на другом сервере.

Вы также можете задать свой сервер идентификации, но тогда вы не можете приглашать пользователей с помощью email-адреса и не можете быть приглашены по нему.", - "Enter keywords separated by a comma:": "Введите ключевые слова, разделенные запятой", "Messages containing my display name": "Сообщения, содержащие мое отображаемое имя", "Messages containing my user name": "Сообщение, содержащие мое имя пользователя", "Messages in group chats": "Сообщения в групповых чатах", From 8ef7dda7bd6bc6d1760b0ddad0676cab6652c53f Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 29 May 2017 16:43:28 +0100 Subject: [PATCH 7/9] fixing missing OK button on TextInputDialog --- src/components/views/settings/Notifications.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index 11948acebe..74b9c24a74 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -178,6 +178,7 @@ module.exports = React.createClass({ Modal.createDialog(TextInputDialog, { title: _t('Keywords'), description: _t('Enter keywords separated by a comma:'), + button: _t('OK'), value: keywords, onFinished: function onFinished(should_leave, newValue) { From 17c4e7a748b5080ab25f3646b8860a75492a4b89 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 29 May 2017 23:49:56 +0100 Subject: [PATCH 8/9] check PL on change as well as on comp load, that way it'll show remove button if PL increases later. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/context_menus/MessageContextMenu.js | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 00fa18f6a8..56758b2f30 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -40,6 +40,31 @@ module.exports = React.createClass({ onFinished: React.PropTypes.func, }, + getInitialState: function() { + return { + canRedact: false, + }; + }, + + componentWillMount: function() { + MatrixClientPeg.get().on('RoomMember.powerLevel', this._checkCanRedact); + this._checkCanRedact(); + }, + + componentWillUnmount: function() { + const cli = MatrixClientPeg.get(); + if (cli) { + cli.removeListener('RoomMember.powerLevel', this._checkCanRedact); + } + }, + + _checkCanRedact: function() { + const cli = MatrixClientPeg.get(); + const room = cli.getRoom(this.props.mxEvent.getRoomId()); + const canRedact = room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId); + this.setState({canRedact}); + }, + onResendClick: function() { Resend.resend(this.props.mxEvent); if (this.props.onFinished) this.props.onFinished(); @@ -136,10 +161,7 @@ module.exports = React.createClass({ ); } - const cli = MatrixClientPeg.get(); - const room = cli.getRoom(this.props.mxEvent.getRoomId()); - - if (room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId)) { + if (this.state.canRedact) { redactButton = (
{ _t('Remove') } @@ -209,7 +231,7 @@ module.exports = React.createClass({ externalURLButton = (
{ _t('Source URL') } + rel="noopener" target="_blank" onClick={ this.closeMenu }>{ _t('Source URL') }
); } From b3426a1268dbe6ecaa2b60f970302cff7a829a60 Mon Sep 17 00:00:00 2001 From: RiotTranslate Date: Tue, 30 May 2017 05:00:36 +0200 Subject: [PATCH 9/9] Update from Weblate. (#4064) * Added translation using Weblate (Ukrainian) * Translated using Weblate (German) Currently translated at 100.0% (120 of 120 strings) Translation: Riot Web/Riot Web Translate-URL: https://translate.nordgedanken.de/projects/riot-web/riot-web/de/ --- src/i18n/strings/de_DE.json | 40 ++++++++++++++++++------------------- src/i18n/strings/uk.json | 1 + 2 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 src/i18n/strings/uk.json diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index d030e29d1a..cbe617b20c 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -5,15 +5,15 @@ "Files": "Dateien", "Notifications": "Benachrichtigungen", "Invite to this room": "In diesen Raum einladen", - "Filter room names": "Raum Namen filtern", + "Filter room names": "Raum-Namen filtern", "Start chat": "Neuen Chat starten", "Room directory": "Raum-Verzeichnis", "Create new room": "Neuen Raum erstellen", "Settings": "Einstellungen", - "powered by Matrix": "gebaut mit Matrix", + "powered by Matrix": "basierend auf Matrix", "Custom Server Options": "Optionen für eigenen Server", "Dismiss": "ausblenden", - "Failed to get protocol list from Home Server": "Fehler beim Abrufen der Protokollliste vom Home Server", + "Failed to get protocol list from Home Server": "Fehler beim Abrufen der Protokoll-Liste vom Home-Server", "The Home Server may be too old to support third party networks": "Der Home-Server ist eventuell zu alt, um Drittanbieter-Netzwerke zu unterstützen", "Directory": "Raum Verzeichnis", "#example:": "#beispiel:", @@ -21,25 +21,25 @@ "No rooms to show": "Keine Räume zum anzeigen", "World readable": "Jeder kann lesen", "Guests can join": "Gäste können beitreten", - "You are not receiving desktop notifications": "Du erhältst keine Desktop Benachrichtigungen", + "You are not receiving desktop notifications": "Du erhältst keine Desktop-Benachrichtigungen", "Enable them now": "Aktiviere diese jetzt", "Add an email address above to configure email notifications": "Füge eine E-Mail Adresse hinzu um Benachrichtigungen via E-Mail zu erhalten", "All notifications are currently disabled for all targets.": "Im Moment sind alle Benachrichtigungen für alle Ziele deaktiviert.", - "An error occurred whilst saving your email notification preferences.": "Ein Fehler trat auf während deine E-Mail Einstellungen gespeichert wurden.", + "An error occurred whilst saving your email notification preferences.": "Beim Speichern deiner E-Mail-Benachrichtigungseinstellungen ist ein Fehler aufgetreten.", "and remove": "und entfernen", "Can't update user notification settings": "Kann Benutzerdefinierte Einstellungen nicht aktualisieren", - "Couldn't find a matching Matrix room": "Kann keinen entsprechenden Matrix Raum finden", + "Couldn't find a matching Matrix room": "Konnte keinen entsprechenden Matrix-Raum finden", "delete the alias": "Lösche den Alias", "Delete the room alias": "Lösche den Raum Alias", "Direct Chat": "Privater Chat", "Drop here to": "Hier ablegen", - "Enable audible notifications in web client": "Aktiviere Audio Benachrichtigungen", - "Enable desktop notifications": "Aktiviere Desktop Benachrichtigungen", + "Enable audible notifications in web client": "Audio-Benachrichtigungen im Web-Client aktivieren", + "Enable desktop notifications": "Desktop-Benachrichtigungen aktivieren", "Enable email notifications": "Aktiviere E-Mail Benachrichtigungen", "Enable notifications for this account": "Aktiviere Benachrichtigungen für diesen Benutzer", - "Enter keywords separated by a comma:": "Trage Schlagworte, mit Komma getrennt, ein", + "Enter keywords separated by a comma:": "Kommagetrennte Schlagworte eingeben:", "Error": "Fehler", - "Error saving email notification preferences": "Fehler beim Speichern der E-Mail Benachrichtigungseinstellungen", + "Error saving email notification preferences": "Fehler beim Speichern der E-Mail-Benachrichtigungseinstellungen", "#example": "#Beispiel", "Failed to": "Konnte nicht", "Failed to add tag ": "Konnte Tag nicht hinzufügen ", @@ -55,18 +55,18 @@ "from the directory": "aus dem Verzeichnis", " from room": " aus dem Raum", "Guest users can't invite users. Please register to invite": "Gastnutzer können keine Nutzer einladen. Bitte registriere dich um Nutzer einzuladen", - "Keywords": "Suchbegriff", + "Keywords": "Schlüsselwörter", "Leave": "Verlassen", "Low Priority": "Niedrige Priorität", "Noisy": "Laut", - "Notification targets": "Benachrichtigungsziel", + "Notification targets": "Benachrichtigungsziele", "Notifications on the following keywords follow rules which can’t be displayed here:": "Benachrichtigungen zu folgenden Stichwörtern folgen Regeln, die hier nicht angezeigt werden können:", - "Notify for all other messages/rooms": "Benachrichtigung für alle anderen Mitteilungen/ Räume", + "Notify for all other messages/rooms": "Benachrichtigungen für alle anderen Mitteilungen/Räume aktivieren", "Operation failed": "Aktion fehlgeschlagen", "Reject": "ablehnen", - "Remove": "Entferne", + "Remove": "Entfernen", "remove": "Entferner", - "Remove from Directory": "Vom Raum Verzeichnis entfernen", + "Remove from Directory": "Aus dem Raum-Verzeichnis entfernen", "Riot does not know how to join a room on this network": "Riot weiß nicht, wie es einem Raum auf diesem Netzwerk beitreten soll", "Room not found": "Raum nicht gefunden", "There are advanced notifications which are not shown here": "Es existieren erweiterte Benachrichtigungen, welche hier nicht angezeigt werden", @@ -79,9 +79,9 @@ "Notify me for anything else": "Benachrichtige mich für alles andere", "Off": "Aus", "On": "An", - "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "Du hast sie eventuell auf einem anderen Client als Riot konfiguriert. Sie sind in Riot nicht anpassbar gelten aber trotzdem", + "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "Du hast sie eventuell auf einem anderen Client als Riot konfiguriert. Sie können in Riot nicht verändert werden, gelten aber trotzdem", " to room": " an Raum", - "Drop here %(toAction)s": "%(toAction)s hierher ziehen", + "Drop here %(toAction)s": "Hierher ziehen: %(toAction)s", "All messages": "Alle Nachrichten", "All messages (loud)": "Alle Nachrichten (laut)", "Cancel Sending": "Senden abbrechen", @@ -107,7 +107,7 @@ "View Decrypted Source": "Entschlüsselten Quellcode ansehen", "View Source": "Quellcode ansehen", "You cannot delete this image. (%(code)s)": "Das Bild kann nicht gelöscht werden. (%(code)s)", - "You cannot delete this message. (%(code)s)": "Die Nachricht kann nicht gelöscht werden. (%(code)s)", + "You cannot delete this message. (%(code)s)": "Diese Nachricht kann nicht gelöscht werden. (%(code)s)", "Today": "Heute", "Wednesday": "Mittwoch", "Thursday": "Donnerstag", @@ -122,10 +122,10 @@ "Call invitation": "Anruf-Einladung", "Messages containing my display name": "Nachrichten, die meinen Anzeigenamen enthalten", "Messages containing my user name": "Nachrichten, die meinen Nutzernamen enthalten", - "Messages in group chats": "Nachrichten in Chat-Gruppen", + "Messages in group chats": "Nachrichten in Gruppen-Chats", "Messages in one-to-one chats": "Nachrichten in Eins-zu-Eins-Chats", "Messages sent by bot": "Nachrichten von Bots", "more": "mehr", "When I'm invited to a room": "Wenn ich in einen Raum eingeladen werde", - "customServer_text": "Du kannst die erweiterten Server-Optioen nutzen um dich an anderen Matrix-Servern mittels anderer Heimserver-URL anzumelden.
Dies erlaubt dir Riot mit einem existierendem Konto auf einem anderen Heimserver zu nutzen.

Du kannst auch einen benutzerdefinierten Identitäts-Server setzen, aber du wirst dann nicht in der Lage sein, Nutzer per E-Mail-Adresse einzuladen oder selbst mit E-Mail-Adresse eingeladen zu werden." + "customServer_text": "Du kannst die erweiterten Server-Optionen nutzen, um dich auf anderen Matrix-Servern anzumelden, indem du eine andere Heimserver-URL eingibst.
Dies ermöglicht es dir, Riot mit einem bereits existierenden Matrix-Konto auf einem anderen Heimserver zu nutzen.

Du kannst auch einen benutzerdefinierten Identitäts-Server eingeben, allerdings wirst du dann nicht in der Lage sein, andere Benutzer per E-Mail-Adresse einzuladen oder selbst Einladungen per E-Mail-Adresse zu erhalten." } diff --git a/src/i18n/strings/uk.json b/src/i18n/strings/uk.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/src/i18n/strings/uk.json @@ -0,0 +1 @@ +{} \ No newline at end of file