Everything but src/components/views/rooms

pull/21833/head
Kegan Dougal 2017-06-08 12:33:29 +01:00
parent 0f4028da07
commit 1c58a9cd5e
17 changed files with 80 additions and 30 deletions

View File

@ -78,7 +78,7 @@ export default React.createClass({
<AccessibleButton onClick={this._onDismissClick}
className="mx_UserSettings_button"
>
Dismiss
{_t("Dismiss")}
</AccessibleButton>
</div>
);

View File

@ -18,7 +18,7 @@ import React from 'react';
import sdk from '../../../index';
import SdkConfig from '../../../SdkConfig';
import Modal from '../../../Modal';
import { _t } from '../../../languageHandler';
import { _t, _tJsx } from '../../../languageHandler';
export default React.createClass({
@ -44,8 +44,11 @@ export default React.createClass({
if (SdkConfig.get().bug_report_endpoint_url) {
bugreport = (
<p>Otherwise, <a onClick={this._sendBugReport} href='#'>
click here</a> to send a bug report.
<p>
{_tJsx(
"Otherwise, <a>click here</a> to send a bug report.",
/<a>(.*?)<\/a>/, (sub) => <a onClick={this._sendBugReport} key="bugreport" href='#'>{sub}</a>
)}
</p>
);
}

View File

@ -80,7 +80,7 @@ export default React.createClass({
/>
</div>
<div className="mx_Dialog_buttons">
<input className="mx_Dialog_primary" type="submit" value="Set" />
<input className="mx_Dialog_primary" type="submit" value={_t("Set")} />
</div>
</form>
</BaseDialog>

View File

@ -145,7 +145,7 @@ export default React.createClass({
console.log("UnknownDeviceDialog closed by escape");
this.props.onFinished();
}}
title='Room contains unknown devices'
title={_t('Room contains unknown devices')}
>
<GeminiScrollbar autoshow={false} className="mx_Dialog_content">
<h4>
@ -162,7 +162,7 @@ export default React.createClass({
this.props.onFinished();
Resend.resendUnsentEvents(this.props.room);
}}>
Send anyway
{_t("Send anyway")}
</button>
<button className="mx_Dialog_primary" autoFocus={ true }
onClick={() => {

View File

@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
var React = require('react');
import { _t } from '../../../languageHandler';
module.exports = React.createClass({
displayName: 'TruncatedList',
@ -33,7 +34,7 @@ module.exports = React.createClass({
truncateAt: 2,
createOverflowElement: function(overflowCount, totalCount) {
return (
<div>And {overflowCount} more...</div>
<div>{_t("And %(count)s more...", {count: overflowCount})}</div>
);
}
};

View File

@ -440,7 +440,7 @@ export const FallbackAuthEntry = React.createClass({
render: function() {
return (
<div>
<a onClick={this._onShowFallbackClick}>Start authentication</a>
<a onClick={this._onShowFallbackClick}>{_t("Start authentication")}</a>
<div className="error">
{this.props.errorText}
</div>

View File

@ -101,7 +101,7 @@ module.exports = React.createClass({
if (this.refs.email.value == '') {
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
Modal.createDialog(QuestionDialog, {
title: "Warning!",
title: _t("Warning!"),
description:
<div>
{_t("If you don't specify an email address, you won't be able to reset your password. " +
@ -335,7 +335,7 @@ module.exports = React.createClass({
);
const registerButton = (
<input className="mx_Login_submit" type="submit" value="Register" />
<input className="mx_Login_submit" type="submit" value={_t("Register")} />
);
let placeholderUserName = _t("User name");

View File

@ -20,6 +20,7 @@ var sdk = require('../../../index');
var Tinter = require('../../../Tinter');
var MatrixClientPeg = require("../../../MatrixClientPeg");
var Modal = require("../../../Modal");
import { _t } from '../../../languageHandler';
var ROOM_COLORS = [
// magic room default values courtesy of Ribot
@ -88,8 +89,8 @@ module.exports = React.createClass({
if (err.errcode == 'M_GUEST_ACCESS_FORBIDDEN') {
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
Modal.createDialog(NeedToRegisterDialog, {
title: "Please Register",
description: "Saving room color settings is only available to registered users"
title: _t("Please Register"),
description: _t("Saving room color settings is only available to registered users")
});
}
});

View File

@ -165,7 +165,7 @@ export default WithMatrixClient(React.createClass({
</div>
</div>
<div className="mx_UserSettings_threepidButton mx_filterFlipColor">
<input type="image" value="Add" src="img/plus.svg" width="14" height="14" />
<input type="image" value={_t("Add")} src="img/plus.svg" width="14" height="14" />
</div>
</form>
);

View File

@ -17,6 +17,7 @@ limitations under the License.
var React = require('react');
var MatrixClientPeg = require("../../../MatrixClientPeg");
var sdk = require('../../../index');
import { _t } from '../../../languageHandler';
module.exports = React.createClass({
displayName: 'ChangeAvatar',
@ -105,7 +106,7 @@ module.exports = React.createClass({
onError: function(error) {
this.setState({
errorText: "Failed to upload profile picture!"
errorText: _t("Failed to upload profile picture!")
});
},
@ -127,7 +128,7 @@ module.exports = React.createClass({
if (this.props.showUploadSection) {
uploadSection = (
<div className={this.props.className}>
Upload new:
{_t("Upload new:")}
<input type="file" accept="image/*" onChange={this.onFileSelected}/>
{this.state.errorText}
</div>

View File

@ -18,6 +18,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: 'ChangeDisplayName',
@ -52,7 +53,7 @@ module.exports = React.createClass({
return (
<EditableTextContainer
getInitialValue={this._getDisplayName}
placeholder="No display name"
placeholder={_t("No display name")}
blurToSubmit={true}
onSubmit={this._changeDisplayName} />
);

View File

@ -48,7 +48,7 @@ module.exports = React.createClass({
onCheckPassword: function(oldPass, newPass, confirmPass) {
if (newPass !== confirmPass) {
return {
error: _t("New passwords don't match") + "."
error: _t("New passwords don't match")
};
} else if (!newPass || newPass.length === 0) {
return {

View File

@ -19,6 +19,7 @@ import classNames from 'classnames';
import sdk from '../../../index';
import MatrixClientPeg from '../../../MatrixClientPeg';
import { _t } from '../../../languageHandler';
export default class DevicesPanel extends React.Component {
@ -54,10 +55,10 @@ export default class DevicesPanel extends React.Component {
var errtxt;
if (error.httpStatus == 404) {
// 404 probably means the HS doesn't yet support the API.
errtxt = "Your home server does not support device management.";
errtxt = _t("Your home server does not support device management.");
} else {
console.error("Error loading devices:", error);
errtxt = "Unable to load device list.";
errtxt = _t("Unable to load device list");
}
this.setState({deviceLoadError: errtxt});
}
@ -127,9 +128,9 @@ export default class DevicesPanel extends React.Component {
return (
<div className={classes}>
<div className="mx_DevicesPanel_header">
<div className="mx_DevicesPanel_deviceId">ID</div>
<div className="mx_DevicesPanel_deviceName">Name</div>
<div className="mx_DevicesPanel_deviceLastSeen">Last seen</div>
<div className="mx_DevicesPanel_deviceId">{_t("Device ID")}</div>
<div className="mx_DevicesPanel_deviceName">{_t("Device Name")}</div>
<div className="mx_DevicesPanel_deviceLastSeen">{_t("Last seen")}</div>
<div className="mx_DevicesPanel_deviceButtons"></div>
</div>
{devices.map(this._renderDevice)}

View File

@ -18,6 +18,7 @@ limitations under the License.
var React = require("react");
var Notifier = require("../../../Notifier");
var dis = require("../../../dispatcher");
import { _t } from '../../../languageHandler';
module.exports = React.createClass({
displayName: 'EnableNotificationsButton',
@ -60,13 +61,13 @@ module.exports = React.createClass({
if (this.enabled()) {
return (
<button className="mx_EnableNotificationsButton" onClick={this.onClick}>
Disable Notifications
{_t("Disable Notifications")}
</button>
);
} else {
return (
<button className="mx_EnableNotificationsButton" onClick={this.onClick}>
Enable Notifications
{_t("Enable Notifications")}
</button>
);
}

View File

@ -18,6 +18,7 @@ var dis = require("../../../dispatcher");
var CallHandler = require("../../../CallHandler");
var sdk = require('../../../index');
var MatrixClientPeg = require("../../../MatrixClientPeg");
import { _t } from '../../../languageHandler';
module.exports = React.createClass({
displayName: 'CallView',
@ -130,7 +131,11 @@ module.exports = React.createClass({
var voice;
if (this.state.call && this.state.call.type === "voice" && this.props.showVoice) {
var callRoom = MatrixClientPeg.get().getRoom(this.state.call.roomId);
voice = <div className="mx_CallView_voice" onClick={ this.props.onClick }>Active call ({ callRoom.name })</div>;
voice = (
<div className="mx_CallView_voice" onClick={ this.props.onClick }>
{_t("Active call (%(roomName)s)", {roomName: callRoom.name})}
</div>
);
}
return (

View File

@ -17,6 +17,7 @@ var React = require('react');
var MatrixClientPeg = require('../../../MatrixClientPeg');
var dis = require("../../../dispatcher");
var CallHandler = require("../../../CallHandler");
import { _t } from '../../../languageHandler';
module.exports = React.createClass({
displayName: 'IncomingCallBox',
@ -45,23 +46,36 @@ module.exports = React.createClass({
room = MatrixClientPeg.get().getRoom(this.props.incomingCall.roomId);
}
var caller = room ? room.name : "unknown";
var caller = room ? room.name : _t("unknown caller");
let incomingCallText = null;
if (this.props.incomingCall) {
if (this.props.incomingCall.type === "voice") {
incomingCallText = _t("Incoming voice call from %(name)s", {name: caller});
}
else if (this.props.incomingCall.type === "video") {
incomingCallText = _t("Incoming video call from %(name)s", {name: caller});
}
else {
incomingCallText = _t("Incoming call from %(name)s", {name: caller});
}
}
return (
<div className="mx_IncomingCallBox" id="incomingCallBox">
<img className="mx_IncomingCallBox_chevron" src="img/chevron-left.png" width="9" height="16" />
<div className="mx_IncomingCallBox_title">
Incoming { this.props.incomingCall ? this.props.incomingCall.type : '' } call from { caller }
{incomingCallText}
</div>
<div className="mx_IncomingCallBox_buttons">
<div className="mx_IncomingCallBox_buttons_cell">
<div className="mx_IncomingCallBox_buttons_decline" onClick={this.onRejectClick}>
Decline
{_t("Decline")}
</div>
</div>
<div className="mx_IncomingCallBox_buttons_cell">
<div className="mx_IncomingCallBox_buttons_accept" onClick={this.onAnswerClick}>
Accept
{_t("Accept")}
</div>
</div>
</div>

View File

@ -122,15 +122,18 @@
"A registered account is required for this action": "A registered account is required for this action",
"A text message has been sent to +%(msisdn)s. Please enter the verification code it contains": "A text message has been sent to +%(msisdn)s. Please enter the verification code it contains",
"accept": "accept",
"Accept": "Accept",
"%(targetName)s accepted an invitation.": "%(targetName)s accepted an invitation.",
"%(targetName)s accepted the invitation for %(displayName)s.": "%(targetName)s accepted the invitation for %(displayName)s.",
"Account": "Account",
"Access Token:": "Access Token:",
"Active call (%(roomName)s)": "Active call (%(roomName)s)",
"Add": "Add",
"Add a topic": "Add a topic",
"Add email address": "Add email address",
"Add phone number": "Add phone number",
"Admin": "Admin",
"And %(count)s more...": "And %(count)s more...",
"VoIP": "VoIP",
"Missing Media Permissions, click here to request.": "Missing Media Permissions, click here to request.",
"No Microphones detected": "No Microphones detected",
@ -230,6 +233,7 @@
"/ddg is not a command": "/ddg is not a command",
"Deactivate Account": "Deactivate Account",
"Deactivate my account": "Deactivate my account",
"Decline": "Decline",
"decline": "decline",
"Decrypt %(text)s": "Decrypt %(text)s",
"Decryption error": "Decryption error",
@ -247,6 +251,7 @@
"Devices will not yet be able to decrypt history from before they joined the room": "Devices will not yet be able to decrypt history from before they joined the room",
"Direct Chat": "Direct Chat",
"Direct chats": "Direct chats",
"Disable Notifications": "Disable Notifications",
"disabled": "disabled",
"Disable inline URL previews by default": "Disable inline URL previews by default",
"Disable markdown formatting": "Disable markdown formatting",
@ -264,6 +269,7 @@
"Email, name or matrix ID": "Email, name or matrix ID",
"Emoji": "Emoji",
"Enable encryption": "Enable encryption",
"Enable Notifications": "Enable Notifications",
"enabled": "enabled",
"Encrypted messages will not be visible on clients that do not yet implement encryption": "Encrypted messages will not be visible on clients that do not yet implement encryption",
"Encrypted room": "Encrypted room",
@ -303,6 +309,7 @@
"Failed to toggle moderator status": "Failed to toggle moderator status",
"Failed to unban": "Failed to unban",
"Failed to upload file": "Failed to upload file",
"Failed to upload profile picture!": "Failed to upload profile picture!",
"Failed to verify email address: make sure you clicked the link in the email": "Failed to verify email address: make sure you clicked the link in the email",
"Failure to create room": "Failure to create room",
"Favourite": "Favourite",
@ -332,6 +339,9 @@
"I have verified my email address": "I have verified my email address",
"Import": "Import",
"Import E2E room keys": "Import E2E room keys",
"Incoming call from %(name)s": "Incoming call from %(name)s",
"Incoming video call from %(name)s": "Incoming video call from %(name)s",
"Incoming voice call from %(name)s": "Incoming voice call from %(name)s",
"Incorrect username and/or password.": "Incorrect username and/or password.",
"Incorrect verification code": "Incorrect verification code",
"Interface Language": "Interface Language",
@ -359,6 +369,7 @@
"Kick": "Kick",
"Kicks user with given id": "Kicks user with given id",
"Labs": "Labs",
"Last seen": "Last seen",
"Leave room": "Leave room",
"left and rejoined": "left and rejoined",
"left": "left",
@ -402,6 +413,7 @@
"<not supported>": "<not supported>",
"NOT verified": "NOT verified",
"No devices with registered encryption keys": "No devices with registered encryption keys",
"No display name": "No display name",
"No more results": "No more results",
"No results": "No results",
"No users have specific privileges in this room": "No users have specific privileges in this room",
@ -411,6 +423,7 @@
"Once you&#39;ve followed the link it contains, click below": "Once you&#39;ve followed the link it contains, click below",
"Only people who have been invited": "Only people who have been invited",
"Operation failed": "Operation failed",
"Otherwise, <a>click here</a> to send a bug report.": "Otherwise, <a>click here</a> to send a bug report.",
"Password": "Password",
"Password:": "Password:",
"Passwords can't be empty": "Passwords can't be empty",
@ -453,9 +466,11 @@
"riot-web version:": "riot-web version:",
"Room %(roomId)s not visible": "Room %(roomId)s not visible",
"Room Colour": "Room Colour",
"Room contains unknown devices": "Room contains unknown devices",
"Room name (optional)": "Room name (optional)",
"Rooms": "Rooms",
"Save": "Save",
"Saving room color settings is only available to registered users": "Saving room color settings is only available to registered users",
"Scroll to bottom of page": "Scroll to bottom of page",
"Scroll to unread messages": "Scroll to unread messages",
"Search": "Search",
@ -464,6 +479,7 @@
"Searching known users": "Searching known users",
"Send a message (unencrypted)": "Send a message (unencrypted)",
"Send an encrypted message": "Send an encrypted message",
"Send anyway": "Send anyway",
"Sender device information": "Sender device information",
"Send Invites": "Send Invites",
"Send Reset Email": "Send Reset Email",
@ -480,6 +496,7 @@
"Session ID": "Session ID",
"%(senderName)s set a profile picture.": "%(senderName)s set a profile picture.",
"%(senderName)s set their display name to %(displayName)s.": "%(senderName)s set their display name to %(displayName)s.",
"Set": "Set",
"Setting a user name will create a fresh account": "Setting a user name will create a fresh account",
"Settings": "Settings",
"Show panel": "Show panel",
@ -494,6 +511,7 @@
"Someone": "Someone",
"Sorry, this homeserver is using a login which is not recognised ": "Sorry, this homeserver is using a login which is not recognised ",
"Start a chat": "Start a chat",
"Start authentication": "Start authentication",
"Start Chat": "Start Chat",
"Submit": "Submit",
"Success": "Success",
@ -561,6 +579,7 @@
"Unable to load device list": "Unable to load device list",
"Unencrypted room": "Unencrypted room",
"unencrypted": "unencrypted",
"unknown caller": "unknown caller",
"Unknown command": "Unknown command",
"unknown device": "unknown device",
"unknown error code": "unknown error code",
@ -580,6 +599,7 @@
"Upload Failed": "Upload Failed",
"Upload Files": "Upload Files",
"Upload file": "Upload file",
"Upload new:": "Upload new:",
"Usage": "Usage",
"Use compact timeline layout": "Use compact timeline layout",
"Use with caution": "Use with caution",
@ -633,6 +653,7 @@
"You seem to be uploading files, are you sure you want to quit?": "You seem to be uploading files, are you sure you want to quit?",
"You should not yet trust it to secure data": "You should not yet trust it to secure data",
"You will not be able to undo this change as you are promoting the user to have the same power level as yourself": "You will not be able to undo this change as you are promoting the user to have the same power level as yourself",
"Your home server does not support device management.": "Your home server does not support device management.",
"Sun": "Sun",
"Mon": "Mon",
"Tue": "Tue",
@ -780,6 +801,7 @@
"To continue, please enter your password.": "To continue, please enter your password.",
"To verify that this device can be trusted, please contact its owner using some other means (e.g. in person or a phone call) and ask them whether the key they see in their User Settings for this device matches the key below:": "To verify that this device can be trusted, please contact its owner using some other means (e.g. in person or a phone call) and ask them whether the key they see in their User Settings for this device matches the key below:",
"Device name": "Device name",
"Device Name": "Device Name",
"Device key": "Device key",
"If it matches, press the verify button below. If it doesn't, then someone else is intercepting this device and you probably want to press the blacklist button instead.": "If it matches, press the verify button below. If it doesn't, then someone else is intercepting this device and you probably want to press the blacklist button instead.",
"In future this verification process will be more sophisticated.": "In future this verification process will be more sophisticated.",