Skip to content

Commit

Permalink
Merge pull request matrix-org#59 from krombel/fix_translations
Browse files Browse the repository at this point in the history
fix some appearances of counterpart.translate by _t
  • Loading branch information
MTRNord authored May 11, 2017
2 parents 95da152 + 90224ab commit f4fb15b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
34 changes: 17 additions & 17 deletions src/CallHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var MatrixClientPeg = require('./MatrixClientPeg');
var PlatformPeg = require("./PlatformPeg");
var Modal = require('./Modal');
var sdk = require('./index');
import counterpart from 'counterpart';
import _t from 'counterpart';
var Matrix = require("matrix-js-sdk");
var dis = require("./dispatcher");

Expand Down Expand Up @@ -143,8 +143,8 @@ function _setCallListeners(call) {
play("busyAudio");
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
title: counterpart.translate("Call Timeout"),
description: counterpart.translate("The remote side failed to pick up") + "."
title: _t("Call Timeout"),
description: _t("The remote side failed to pick up") + "."
});
}
else if (oldState === "invite_sent") {
Expand Down Expand Up @@ -204,7 +204,7 @@ function _onAction(payload) {
console.log("Can't capture screen: " + screenCapErrorString);
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
title: counterpart.translate("Unable to capture screen"),
title: _t("Unable to capture screen"),
description: screenCapErrorString
});
return;
Expand All @@ -224,8 +224,8 @@ function _onAction(payload) {
if (module.exports.getAnyActiveCall()) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
title: counterpart.translate("Existing Call"),
description: counterpart.translate("You are already in a call") + "."
title: _t("Existing Call"),
description: _t("You are already in a call") + "."
});
return; // don't allow >1 call to be placed.
}
Expand All @@ -234,8 +234,8 @@ function _onAction(payload) {
if (!MatrixClientPeg.get().supportsVoip()) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
title: counterpart.translate("VoIP is unsupported"),
description: counterpart.translate("You cannot place VoIP calls in this browser") + "."
title: _t("VoIP is unsupported"),
description: _t("You cannot place VoIP calls in this browser") + "."
});
return;
}
Expand All @@ -250,7 +250,7 @@ function _onAction(payload) {
if (members.length <= 1) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
description: counterpart.translate("You cannot place a call with yourself") + "."
description: _t("You cannot place a call with yourself") + "."
});
return;
}
Expand All @@ -276,14 +276,14 @@ function _onAction(payload) {
if (!ConferenceHandler) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
description: counterpart.translate("Conference calls are not supported in this client")
description: _t("Conference calls are not supported in this client")
});
}
else if (!MatrixClientPeg.get().supportsVoip()) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
title: counterpart.translate("VoIP is unsupported"),
description: counterpart.translate("You cannot place VoIP calls in this browser") + "."
title: _t("VoIP is unsupported"),
description: _t("You cannot place VoIP calls in this browser") + "."
});
}
else if (MatrixClientPeg.get().isRoomEncrypted(payload.room_id)) {
Expand All @@ -295,14 +295,14 @@ function _onAction(payload) {
// Therefore we disable conference calling in E2E rooms.
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
description: counterpart.translate("Conference calls are not supported in encrypted rooms"),
description: _t("Conference calls are not supported in encrypted rooms"),
});
}
else {
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
Modal.createDialog(QuestionDialog, {
title: counterpart.translate("Warning") + "!",
description: counterpart.translate("Conference calling is in development and may not be reliable") + ".",
title: _t("Warning") + "!",
description: _t("Conference calling is in development and may not be reliable") + ".",
onFinished: confirm=>{
if (confirm) {
ConferenceHandler.createNewMatrixCall(
Expand All @@ -313,8 +313,8 @@ function _onAction(payload) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Conference call failed: " + err);
Modal.createDialog(ErrorDialog, {
title: counterpart.translate("Failed to set up conference call"),
description: counterpart.translate("Conference call failed") + ". " + ((err && err.message) ? err.message : ""),
title: _t("Failed to set up conference call"),
description: _t("Conference call failed") + ". " + ((err && err.message) ? err.message : ""),
});
});
}
Expand Down
12 changes: 6 additions & 6 deletions src/components/views/rooms/RoomPreviewBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var React = require('react');
var sdk = require('../../../index');
var MatrixClientPeg = require('../../../MatrixClientPeg');

import counterpart from 'counterpart';
import _t from 'counterpart';

module.exports = React.createClass({
displayName: 'RoomPreviewBar',
Expand Down Expand Up @@ -133,10 +133,10 @@ module.exports = React.createClass({
joinBlock = (
<div>
<div className="mx_RoomPreviewBar_invite_text">
{ counterpart.translate("You have been invited to join this room by") } <b>{ this.props.inviterName }</b>
{ _t("You have been invited to join this room by") } <b>{ this.props.inviterName }</b>
</div>
<div className="mx_RoomPreviewBar_join_text">
{ counterpart.translate("Would you like to") } <a onClick={ this.props.onJoinClick }>{ counterpart.translate("accept") }</a> or <a onClick={ this.props.onRejectClick }>{ counterpart.translate("decline") }</a> { counterpart.translate("this invitation?") }
{ _t("Would you like to") } <a onClick={ this.props.onJoinClick }>{ _t("accept") }</a> { _t("or") } <a onClick={ this.props.onRejectClick }>{ _t("decline") }</a> { _t("this invitation?") }
</div>
{emailMatchBlock}
</div>
Expand Down Expand Up @@ -188,8 +188,8 @@ module.exports = React.createClass({
joinBlock = (
<div>
<div className="mx_RoomPreviewBar_join_text">
{ counterpart.translate("You are trying to access %(roomName)", {roomName: name}) }.<br/>
<a onClick={ this.props.onJoinClick }><b>{ counterpart.translate("Click here") }</b></a> { counterpart.translate("to join the discussion") }!
{ _t("You are trying to access %(roomName)", {roomName: name}) }.<br/>
<a onClick={ this.props.onJoinClick }><b>{ _t("Click here") }</b></a> { _t("to join the discussion") }!
</div>
</div>
);
Expand All @@ -198,7 +198,7 @@ module.exports = React.createClass({
if (this.props.canPreview) {
previewBlock = (
<div className="mx_RoomPreviewBar_preview_text">
{ counterpart.translate("This is a preview of this room. Room interactions have been disabled") }.
{ _t("This is a preview of this room. Room interactions have been disabled") }.
</div>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/settings/AddPhoneNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/

import React from 'react';
import counterpart from 'counterpart';
import _t from 'counterpart';

import sdk from '../../../index';
import AddThreepid from '../../../AddThreepid';
Expand Down Expand Up @@ -158,7 +158,7 @@ export default WithMatrixClient(React.createClass({
<input type="text"
ref={this._collectAddMsisdnInput}
className="mx_UserSettings_phoneNumberField"
placeholder={ counterpart.translate("Add phone number") }
placeholder={ _t("Add phone number") }
value={this.state.phoneNumber}
onChange={this._onPhoneNumberChange}
/>
Expand Down

0 comments on commit f4fb15b

Please sign in to comment.