Skip to content

Commit 3cff8c1

Browse files
committed
Mark some strings as translatable
Signed-off-by: Stefan Parviainen <pafcu@iki.fi>
1 parent ef503cc commit 3cff8c1

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎src/components/views/context_menus/RoomTileContextMenu.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Promise from 'bluebird';
2121
import React from 'react';
2222
import classNames from 'classnames';
2323
import sdk from 'matrix-react-sdk';
24-
import { _t } from 'matrix-react-sdk/lib/languageHandler';
24+
import { _t, _td } from 'matrix-react-sdk/lib/languageHandler';
2525
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
2626
import dis from 'matrix-react-sdk/lib/dispatcher';
2727
import DMRoomMap from 'matrix-react-sdk/lib/utils/DMRoomMap';
@@ -185,7 +185,7 @@ module.exports = React.createClass({
185185
MatrixClientPeg.get().forget(this.props.room.roomId).done(function() {
186186
dis.dispatch({ action: 'view_next_room' });
187187
}, function(err) {
188-
var errCode = err.errcode || "unknown error code";
188+
var errCode = err.errcode || _td("unknown error code");
189189
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
190190
Modal.createTrackedDialog('Failed to forget room', '', ErrorDialog, {
191191
title: _t('Failed to forget room %(errCode)s', {errCode: errCode}),

‎src/notifications/VectorPushRulesDefinitions.js‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ limitations under the License.
1616

1717
'use strict';
1818

19+
import { _td } from 'matrix-react-sdk/lib/languageHandler';
20+
1921
var StandardActions = require('./StandardActions');
2022
var PushRuleVectorState = require('./PushRuleVectorState');
2123

@@ -65,7 +67,7 @@ module.exports = {
6567
// Messages containing user's display name
6668
".m.rule.contains_display_name": new VectorPushRuleDefinition({
6769
kind: "override",
68-
description: "Messages containing my display name", // passed through _t() translation in src/components/views/settings/Notifications.js
70+
description: _td("Messages containing my display name"), // passed through _t() translation in src/components/views/settings/Notifications.js
6971
vectorStateToActions: { // The actions for each vector state, or null to disable the rule.
7072
on: StandardActions.ACTION_NOTIFY,
7173
loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND,
@@ -76,7 +78,7 @@ module.exports = {
7678
// Messages containing user's username (localpart/MXID)
7779
".m.rule.contains_user_name": new VectorPushRuleDefinition({
7880
kind: "override",
79-
description: "Messages containing my user name", // passed through _t() translation in src/components/views/settings/Notifications.js
81+
description: _td("Messages containing my user name"), // passed through _t() translation in src/components/views/settings/Notifications.js
8082
vectorStateToActions: { // The actions for each vector state, or null to disable the rule.
8183
on: StandardActions.ACTION_NOTIFY,
8284
loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND,
@@ -87,7 +89,7 @@ module.exports = {
8789
// Messages just sent to the user in a 1:1 room
8890
".m.rule.room_one_to_one": new VectorPushRuleDefinition({
8991
kind: "underride",
90-
description: "Messages in one-to-one chats", // passed through _t() translation in src/components/views/settings/Notifications.js
92+
description: _td("Messages in one-to-one chats"), // passed through _t() translation in src/components/views/settings/Notifications.js
9193
vectorStateToActions: {
9294
on: StandardActions.ACTION_NOTIFY,
9395
loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND,
@@ -100,7 +102,7 @@ module.exports = {
100102
// By opposition, all other room messages are from group chat rooms.
101103
".m.rule.message": new VectorPushRuleDefinition({
102104
kind: "underride",
103-
description: "Messages in group chats", // passed through _t() translation in src/components/views/settings/Notifications.js
105+
description: _td("Messages in group chats"), // passed through _t() translation in src/components/views/settings/Notifications.js
104106
vectorStateToActions: {
105107
on: StandardActions.ACTION_NOTIFY,
106108
loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND,
@@ -111,7 +113,7 @@ module.exports = {
111113
// Invitation for the user
112114
".m.rule.invite_for_me": new VectorPushRuleDefinition({
113115
kind: "underride",
114-
description: "When I'm invited to a room", // passed through _t() translation in src/components/views/settings/Notifications.js
116+
description: _td("When I'm invited to a room"), // passed through _t() translation in src/components/views/settings/Notifications.js
115117
vectorStateToActions: {
116118
on: StandardActions.ACTION_NOTIFY,
117119
loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND,
@@ -122,7 +124,7 @@ module.exports = {
122124
// Incoming call
123125
".m.rule.call": new VectorPushRuleDefinition({
124126
kind: "underride",
125-
description: "Call invitation", // passed through _t() translation in src/components/views/settings/Notifications.js
127+
description: _td("Call invitation"), // passed through _t() translation in src/components/views/settings/Notifications.js
126128
vectorStateToActions: {
127129
on: StandardActions.ACTION_NOTIFY,
128130
loud: StandardActions.ACTION_NOTIFY_RING_SOUND,
@@ -133,7 +135,7 @@ module.exports = {
133135
// Notifications from bots
134136
".m.rule.suppress_notices": new VectorPushRuleDefinition({
135137
kind: "override",
136-
description: "Messages sent by bot", // passed through _t() translation in src/components/views/settings/Notifications.js
138+
description: _td("Messages sent by bot"), // passed through _t() translation in src/components/views/settings/Notifications.js
137139
vectorStateToActions: {
138140
// .m.rule.suppress_notices is a "negative" rule, we have to invert its enabled value for vector UI
139141
on: StandardActions.ACTION_DISABLED,

0 commit comments

Comments
 (0)