diff --git a/src/components/views/rooms/AuxPanel.js b/src/components/views/rooms/AuxPanel.js
index f53512e684..7e7a670aea 100644
--- a/src/components/views/rooms/AuxPanel.js
+++ b/src/components/views/rooms/AuxPanel.js
@@ -19,7 +19,7 @@ import MatrixClientPeg from "../../../MatrixClientPeg";
import sdk from '../../../index';
import dis from "../../../dispatcher";
import ObjectUtils from '../../../ObjectUtils';
-import { _t } from '../../../languageHandler';
+import { _t, _tJsx} from '../../../languageHandler';
module.exports = React.createClass({
@@ -78,7 +78,7 @@ module.exports = React.createClass({
fileDropTarget = (
+ title={_t("Drop File Here")}>
{_t("Drop file here to upload")}
@@ -95,9 +95,14 @@ module.exports = React.createClass({
}
else {
joinText = (
- Join as { this.onConferenceNotificationClick(event, 'voice');}}
- href="#">voice or { this.onConferenceNotificationClick(event, 'video'); }}
- href="#">video.
+ {_tJsx(
+ "Join as voice or video.",
+ [/(.*?)<\/a>/, /(.*?)<\/a>/],
+ [
+ (sub) => { this.onConferenceNotificationClick(event, 'voice');}} href="#">{sub},
+ (sub) => { this.onConferenceNotificationClick(event, 'video');}} href="#">{sub},
+ ]
+ )}
);
}
diff --git a/src/components/views/rooms/EntityTile.js b/src/components/views/rooms/EntityTile.js
index 71e8fb0be7..015b7b4603 100644
--- a/src/components/views/rooms/EntityTile.js
+++ b/src/components/views/rooms/EntityTile.js
@@ -21,6 +21,7 @@ var React = require('react');
var MatrixClientPeg = require('../../../MatrixClientPeg');
var sdk = require('../../../index');
import AccessibleButton from '../elements/AccessibleButton';
+import { _t } from '../../../languageHandler';
var PRESENCE_CLASS = {
@@ -140,10 +141,10 @@ module.exports = React.createClass({
var power;
var powerLevel = this.props.powerLevel;
if (powerLevel >= 50 && powerLevel < 99) {
- power =
;
+ power =
;
}
if (powerLevel >= 99) {
- power =
;
+ power =
;
}
diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js
index e527f53170..80f062aef7 100644
--- a/src/components/views/rooms/EventTile.js
+++ b/src/components/views/rooms/EventTile.js
@@ -487,22 +487,22 @@ module.exports = WithMatrixClient(React.createClass({
let e2e;
// cosmetic padlocks:
if ((e2eEnabled && this.props.eventSendStatus) || this.props.mxEvent.getType() === 'm.room.encryption') {
- e2e =
;
+ e2e =
;
}
// real padlocks
else if (this.props.mxEvent.isEncrypted() || (e2eEnabled && this.props.eventSendStatus)) {
if (this.props.mxEvent.getContent().msgtype === 'm.bad.encrypted') {
- e2e =
;
+ e2e =
;
}
else if (this.state.verified == true || (e2eEnabled && this.props.eventSendStatus)) {
- e2e =
;
+ e2e =
;
}
else {
- e2e =
;
+ e2e =
;
}
}
else if (e2eEnabled) {
- e2e =
;
+ e2e =
;
}
const timestamp = this.props.mxEvent.getTs() ?
: null;
diff --git a/src/components/views/rooms/MemberDeviceInfo.js b/src/components/views/rooms/MemberDeviceInfo.js
index af44bf7f99..33b919835c 100644
--- a/src/components/views/rooms/MemberDeviceInfo.js
+++ b/src/components/views/rooms/MemberDeviceInfo.js
@@ -26,19 +26,19 @@ export default class MemberDeviceInfo extends React.Component {
if (this.props.device.isBlocked()) {
indicator = (
-
+
);
} else if (this.props.device.isVerified()) {
indicator = (
-
+
);
} else {
indicator = (
-
+
);
}
diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js
index 86d39f91ec..0c66dd4f11 100644
--- a/src/components/views/rooms/MemberInfo.js
+++ b/src/components/views/rooms/MemberInfo.js
@@ -378,7 +378,7 @@ module.exports = WithMatrixClient(React.createClass({
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
Modal.createDialog(NeedToRegisterDialog, {
title: _t("Please Register"),
- description: _t("This action cannot be performed by a guest user. Please register to be able to do this") + ".",
+ description: _t("This action cannot be performed by a guest user. Please register to be able to do this."),
});
} else {
console.error("Toggle moderator error:" + err);
@@ -436,7 +436,7 @@ module.exports = WithMatrixClient(React.createClass({
title: _t("Warning!"),
description:
- { _t("You will not be able to undo this change as you are promoting the user to have the same power level as yourself") }.
+ { _t("You will not be able to undo this change as you are promoting the user to have the same power level as yourself.") }
{ _t("Are you sure?") }
,
button: _t("Continue"),
@@ -705,7 +705,7 @@ module.exports = WithMatrixClient(React.createClass({
if (kickButton || banButton || muteButton || giveModButton) {
adminTools =
-
Admin tools
+
{_t("Admin tools")}
{muteButton}
@@ -743,7 +743,7 @@ module.exports = WithMatrixClient(React.createClass({
{ this.props.member.userId }
- { _t("Level") }:
+ { _t("Level:") }
- {files[i].name || 'Attachment'}
+ {files[i].name || _t('Attachment')}
);
}
@@ -291,7 +291,7 @@ export default class MessageComposer extends React.Component {
const formattingButton = (
{ _t("(~%(searchCount)s results)", { searchCount: this.props.searchInfo.searchCount }) } ;
+ searchStatus =
{ _t("(~%(count)s results)", { count: this.props.searchInfo.searchCount }) }
;
}
// XXX: this is a bit inefficient - we could just compare room.name for 'Empty room'...
@@ -288,7 +288,7 @@ module.exports = React.createClass({
var settings_button;
if (this.props.onSettingsClick) {
settings_button =
-
+
;
}
diff --git a/src/components/views/rooms/RoomNameEditor.js b/src/components/views/rooms/RoomNameEditor.js
index 773b713584..0fc2d1669c 100644
--- a/src/components/views/rooms/RoomNameEditor.js
+++ b/src/components/views/rooms/RoomNameEditor.js
@@ -19,6 +19,7 @@ limitations under the License.
var React = require('react');
var sdk = require('../../../index');
var MatrixClientPeg = require('../../../MatrixClientPeg');
+import { _t } from '../../../languageHandler';
module.exports = React.createClass({
displayName: 'RoomNameEditor',
@@ -35,8 +36,8 @@ module.exports = React.createClass({
this._initialName = name ? name.getContent().name : '';
- this._placeholderName = "Unnamed Room";
- if (defaultName && defaultName !== 'Empty room') {
+ this._placeholderName = _t("Unnamed Room");
+ if (defaultName && defaultName !== 'Empty room') { // default name from JS SDK, needs no translation as we don't ever show it.
this._placeholderName += " (" + defaultName + ")";
}
},
diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js
index b20b2ef58e..8aa1f353a6 100644
--- a/src/components/views/rooms/RoomPreviewBar.js
+++ b/src/components/views/rooms/RoomPreviewBar.js
@@ -21,7 +21,7 @@ var React = require('react');
var sdk = require('../../../index');
var MatrixClientPeg = require('../../../MatrixClientPeg');
-import { _t } from '../../../languageHandler';
+import { _t, _tJsx } from '../../../languageHandler';
module.exports = React.createClass({
displayName: 'RoomPreviewBar',
@@ -84,7 +84,7 @@ module.exports = React.createClass({
},
_roomNameElement: function(fallback) {
- fallback = fallback || 'a room';
+ fallback = fallback || _t('a room');
const name = this.props.room ? this.props.room.name : (this.props.room_alias || "");
return name ? name : fallback;
},
@@ -114,8 +114,7 @@ module.exports = React.createClass({
if (this.props.invitedEmail) {
if (this.state.threePidFetchError) {
emailMatchBlock =
- Unable to ascertain that the address this invite was
- sent to matches one associated with your account.
+ {_t("Unable to ascertain that the address this invite was sent to matches one associated with your account.")}
;
} else if (this.state.invitedEmailMxid != MatrixClientPeg.get().credentials.userId) {
emailMatchBlock =
@@ -124,28 +123,35 @@ module.exports = React.createClass({
- This invitation was sent to {this.props.invitedEmail}, which is not associated with this account.
- You may wish to login with a different account, or add this email to this account.
+ {_t("This invitation was sent to an email address which is not associated with this account:")}
+ {this.props.invitedEmail}
+
+ {_t("You may wish to login with a different account, or add this email to this account.")}
;
}
}
- // TODO: find a way to respect HTML in counterpart!
joinBlock = (
{ _t('You have been invited to join this room by %(inviterName)s', {inviterName: this.props.inviterName}) }
{emailMatchBlock}
);
} else if (kicked || banned) {
- const verb = kicked ? 'kicked' : 'banned';
- const roomName = this._roomNameElement('this room');
+ const roomName = this._roomNameElement(_t('This room'));
const kickerMember = this.props.room.currentState.getMember(
myMember.events.member.getSender()
);
@@ -153,29 +159,39 @@ module.exports = React.createClass({
kickerMember.name : myMember.events.member.getSender();
let reason;
if (myMember.events.member.getContent().reason) {
- reason =
Reason: {myMember.events.member.getContent().reason}
+ reason =
{_t("Reason: %(reasonText)s", {reasonText: myMember.events.member.getContent().reason})}
}
let rejoinBlock;
if (!banned) {
- rejoinBlock =
;
+ rejoinBlock =
;
}
+
+ let actionText;
+ if (kicked) {
+ actionText = _t("You have been kicked from %(roomName)s by %(userName)s.", {roomName: roomName, userName: kickerName});
+ }
+ else if (banned) {
+ actionText = _t("You have been banned from %(roomName)s by %(userName)s.", {roomName: roomName, userName: kickerName});
+ } // no other options possible due to the kicked || banned check above.
+
joinBlock = (
- You have been {verb} from {roomName} by {kickerName}.
+ {actionText}
+
{reason}
{rejoinBlock}
-
Forget
+
{_t("Forget room")}
);
} else if (this.props.error) {
- var name = this.props.roomAlias || "This room";
+ var name = this.props.roomAlias || _t("This room");
var error;
if (this.props.error.errcode == 'M_NOT_FOUND') {
- error = name + " does not exist";
+ error = _t("%(roomName)s does not exist.", {roomName: name});
} else {
- error = name + " is not accessible at this time";
+ error = _t("%(roomName)s is not accessible at this time.", {roomName: name});
}
joinBlock = (
@@ -189,8 +205,12 @@ module.exports = React.createClass({
joinBlock = (
);
diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js
index 205f614ba2..f31fc68afc 100644
--- a/src/components/views/rooms/RoomSettings.js
+++ b/src/components/views/rooms/RoomSettings.js
@@ -17,7 +17,7 @@ limitations under the License.
import q from 'q';
import React from 'react';
-import { _t } from '../../../languageHandler';
+import { _t, _tJsx } from '../../../languageHandler';
import MatrixClientPeg from '../../../MatrixClientPeg';
import SdkConfig from '../../../SdkConfig';
import sdk from '../../../index';
@@ -46,7 +46,7 @@ const BannedUser = React.createClass({
const ConfirmUserActionDialog = sdk.getComponent("dialogs.ConfirmUserActionDialog");
Modal.createDialog(ConfirmUserActionDialog, {
member: this.props.member,
- action: 'Unban',
+ action: _t('Unban'),
danger: false,
onFinished: (proceed) => {
if (!proceed) return;
@@ -597,7 +597,7 @@ module.exports = React.createClass({
?
:
}
- { isEncrypted ? "Encryption is enabled in this room" : "Encryption is not enabled in this room" }.
+ { isEncrypted ? _t("Encryption is enabled in this room") : _t("Encryption is not enabled in this room") }.
{ settings }
@@ -653,7 +653,7 @@ module.exports = React.createClass({
{Object.keys(user_levels).map(function(user, i) {
return (
- { user } { _t('is a') }
+ { _t("%(user)s is a", {user: user}) }
);
})}
@@ -754,7 +754,11 @@ module.exports = React.createClass({
if (this.state.join_rule === "public" && aliasCount == 0) {
addressWarning =
;
}
diff --git a/src/components/views/rooms/SimpleRoomHeader.js b/src/components/views/rooms/SimpleRoomHeader.js
index a6f342af86..44ec7c29aa 100644
--- a/src/components/views/rooms/SimpleRoomHeader.js
+++ b/src/components/views/rooms/SimpleRoomHeader.js
@@ -20,6 +20,7 @@ import React from 'react';
import dis from '../../../dispatcher';
import AccessibleButton from '../elements/AccessibleButton';
import sdk from '../../../index';
+import { _t } from '../../../languageHandler';
// cancel button which is shared between room header and simple room header
export function CancelButton(props) {
@@ -28,7 +29,7 @@ export function CancelButton(props) {
return (
+ width="18" height="18" alt={_t("Cancel")}/>
);
}
diff --git a/src/components/views/rooms/TopUnreadMessagesBar.js b/src/components/views/rooms/TopUnreadMessagesBar.js
index 45aba66633..aa1f86483e 100644
--- a/src/components/views/rooms/TopUnreadMessagesBar.js
+++ b/src/components/views/rooms/TopUnreadMessagesBar.js
@@ -41,7 +41,7 @@ module.exports = React.createClass({