From 2a122a25faf0fd67574cfc5394f4bc5ce5c6c6ef Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 30 May 2017 17:39:41 +0100 Subject: [PATCH 1/3] Translate notification strings --- src/components/views/settings/Notifications.js | 18 ++++++++++++++---- src/i18n/strings/en_EN.json | 1 + .../VectorPushRulesDefinitions.js | 14 +++++++------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index 74b9c24a7..1b8de52d9 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -16,7 +16,7 @@ limitations under the License. 'use strict'; var React = require('react'); -import { _t } from 'matrix-react-sdk/lib/languageHandler'; +import { _t, _tJsx } from 'matrix-react-sdk/lib/languageHandler'; var q = require("q"); var sdk = require('matrix-react-sdk'); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); @@ -535,7 +535,16 @@ module.exports = React.createClass({ // it corresponds to all content push rules (stored in self.state.vectorContentRule) self.state.vectorPushRules.push({ "vectorRuleId": "_keywords", - "description" : (Messages containing keywords), + "description" : ( + + { _tJsx('Messages containing keywords', + /(.*?)<\/span>/, + (sub) => { + return {sub}; + } + )} + + ), "vectorState": self.state.vectorContentRules.vectorState }); } @@ -549,7 +558,7 @@ module.exports = React.createClass({ self.state.vectorPushRules.push({ "vectorRuleId": vectorRuleId, - "description" : ruleDefinition.description, + "description" : _t(ruleDefinition.description), // Text from VectorPushRulesDefinitions.js "rule": rule, "vectorState": vectorState, }); @@ -590,6 +599,7 @@ module.exports = React.createClass({ phase: self.phases.DISPLAY }); }, function(error) { + console.error(error); self.setState({ phase: self.phases.ERROR }); @@ -624,7 +634,7 @@ module.exports = React.createClass({ return ( - {title} + { title } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 4f3467ae0..adf0800d3 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -59,6 +59,7 @@ "Members": "Members", "Mentions only": "Mentions only", "Messages containing my display name": "Messages containing my display name", + "Messages containing keywords": "Messages containing keywords", "Messages containing my user name": "Messages containing my user name", "Messages in group chats": "Messages in group chats", "Messages in one-to-one chats": "Messages in one-to-one chats", diff --git a/src/notifications/VectorPushRulesDefinitions.js b/src/notifications/VectorPushRulesDefinitions.js index d696451d5..df6db6c35 100644 --- a/src/notifications/VectorPushRulesDefinitions.js +++ b/src/notifications/VectorPushRulesDefinitions.js @@ -65,7 +65,7 @@ module.exports = { // Messages containing user's display name ".m.rule.contains_display_name": new VectorPushRuleDefinition({ kind: "override", - description: "Messages containing my display name", + description: "Messages containing my display name", // passed through _t() translation in src/components/views/settings/Notifications.js vectorStateToActions: { // The actions for each vector state, or null to disable the rule. on: StandardActions.ACTION_NOTIFY, loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND, @@ -76,7 +76,7 @@ module.exports = { // Messages containing user's username (localpart/MXID) ".m.rule.contains_user_name": new VectorPushRuleDefinition({ kind: "override", - description: "Messages containing my user name", + description: "Messages containing my user name", // passed through _t() translation in src/components/views/settings/Notifications.js vectorStateToActions: { // The actions for each vector state, or null to disable the rule. on: StandardActions.ACTION_NOTIFY, loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND, @@ -87,7 +87,7 @@ module.exports = { // Messages just sent to the user in a 1:1 room ".m.rule.room_one_to_one": new VectorPushRuleDefinition({ kind: "underride", - description: "Messages in one-to-one chats", + description: "Messages in one-to-one chats", // passed through _t() translation in src/components/views/settings/Notifications.js vectorStateToActions: { on: StandardActions.ACTION_NOTIFY, loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND, @@ -100,7 +100,7 @@ module.exports = { // By opposition, all other room messages are from group chat rooms. ".m.rule.message": new VectorPushRuleDefinition({ kind: "underride", - description: "Messages in group chats", + description: "Messages in group chats", // passed through _t() translation in src/components/views/settings/Notifications.js vectorStateToActions: { on: StandardActions.ACTION_NOTIFY, loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND, @@ -111,7 +111,7 @@ module.exports = { // Invitation for the user ".m.rule.invite_for_me": new VectorPushRuleDefinition({ kind: "underride", - description: "When I'm invited to a room", + description: "When I'm invited to a room", // passed through _t() translation in src/components/views/settings/Notifications.js vectorStateToActions: { on: StandardActions.ACTION_NOTIFY, loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND, @@ -122,7 +122,7 @@ module.exports = { // Incoming call ".m.rule.call": new VectorPushRuleDefinition({ kind: "underride", - description: "Call invitation", + description: "Call invitation", // passed through _t() translation in src/components/views/settings/Notifications.js vectorStateToActions: { on: StandardActions.ACTION_NOTIFY, loud: StandardActions.ACTION_NOTIFY_RING_SOUND, @@ -133,7 +133,7 @@ module.exports = { // Notifications from bots ".m.rule.suppress_notices": new VectorPushRuleDefinition({ kind: "override", - description: "Messages sent by bot", + description: "Messages sent by bot", // passed through _t() translation in src/components/views/settings/Notifications.js vectorStateToActions: { // .m.rule.suppress_notices is a "negative" rule, we have to invert its enabled value for vector UI on: StandardActions.ACTION_DISABLED, From 676bd6196f486be71016a11b7ffb3ac84637291e Mon Sep 17 00:00:00 2001 From: turt2live Date: Tue, 30 May 2017 13:07:49 -0600 Subject: [PATCH 2/3] Show 12hr time on hover too Signed-off-by: Travis Ralston --- src/components/views/messages/MessageTimestamp.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/views/messages/MessageTimestamp.js b/src/components/views/messages/MessageTimestamp.js index dacfad925..586ca94cc 100644 --- a/src/components/views/messages/MessageTimestamp.js +++ b/src/components/views/messages/MessageTimestamp.js @@ -16,7 +16,6 @@ limitations under the License. 'use strict'; -import * as UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore'; const React = require('react'); const DateUtils = require('matrix-react-sdk/lib/DateUtils'); @@ -30,7 +29,7 @@ module.exports = React.createClass({ render: function() { const date = new Date(this.props.ts); return ( - + { DateUtils.formatTime(date, this.props.showTwelveHour) } ); From e79df6a947ef56533138a6f001abbe0c84a567dd Mon Sep 17 00:00:00 2001 From: RiotTranslate Date: Tue, 30 May 2017 21:14:23 +0200 Subject: [PATCH 3/3] Update from Weblate. (#4091) * 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/ * Translated using Weblate (German) Currently translated at 99.1% (119 of 120 strings) Translation: Riot Web/Riot Web Translate-URL: https://translate.nordgedanken.de/projects/riot-web/riot-web/de/ * 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/ * 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/ * 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/ * 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/ * 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/ * 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index c13504a43..32d0f8151 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -37,7 +37,7 @@ "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:": "Kommagetrennte Schlagworte eingeben:", + "Enter keywords separated by a comma:": "Schlagworte kommagetrennt eingeben:", "Error": "Fehler", "Error saving email notification preferences": "Fehler beim Speichern der E-Mail-Benachrichtigungseinstellungen", "#example": "#Beispiel",