Translate src/components/context_menus|dialogs

pull/4122/head
Kegan Dougal 2017-05-31 15:40:49 +01:00
parent 020d496cb1
commit 162f3872e5
4 changed files with 38 additions and 19 deletions

View File

@ -182,7 +182,7 @@ module.exports = React.createClass({
if (content.msgtype && content.msgtype !== 'm.bad.encrypted' && content.hasOwnProperty('body')) { if (content.msgtype && content.msgtype !== 'm.bad.encrypted' && content.hasOwnProperty('body')) {
forwardButton = ( forwardButton = (
<div className="mx_MessageContextMenu_field" onClick={this.onForwardClick}> <div className="mx_MessageContextMenu_field" onClick={this.onForwardClick}>
Forward Message { _t('Forward Message') }
</div> </div>
); );
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
import React from 'react'; import React from 'react';
import sdk from 'matrix-react-sdk'; import sdk from 'matrix-react-sdk';
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig'; import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
export default class BugReportDialog extends React.Component { export default class BugReportDialog extends React.Component {
constructor(props, context) { constructor(props, context) {
@ -49,12 +50,12 @@ export default class BugReportDialog extends React.Component {
const userText = this.state.text; const userText = this.state.text;
if (!sendLogs && userText.trim().length === 0) { if (!sendLogs && userText.trim().length === 0) {
this.setState({ this.setState({
err: "Please describe the bug and/or send logs.", err: _t("Please describe the bug and/or send logs."),
}); });
return; return;
} }
this.setState({ busy: true, progress: null, err: null }); this.setState({ busy: true, progress: null, err: null });
this._sendProgressCallback("Loading bug report module"); this._sendProgressCallback(_t("Loading bug report module"));
require(['../../../vector/submit-rageshake'], (s) => { require(['../../../vector/submit-rageshake'], (s) => {
s(SdkConfig.get().bug_report_endpoint_url, { s(SdkConfig.get().bug_report_endpoint_url, {
@ -69,8 +70,9 @@ export default class BugReportDialog extends React.Component {
}, (err) => { }, (err) => {
if (!this._unmounted) { if (!this._unmounted) {
this.setState({ this.setState({
busy: false, progress: null, busy: false,
err: `Failed to send report: ${err.message}`, progress: null,
err: _t("Failed to send report: ") + `${err.message}`,
}); });
} }
}); });
@ -105,7 +107,7 @@ export default class BugReportDialog extends React.Component {
let cancelButton = null; let cancelButton = null;
if (!this.state.busy) { if (!this.state.busy) {
cancelButton = <button onClick={this._onCancel}> cancelButton = <button onClick={this._onCancel}>
Cancel { _t("Cancel") }
</button>; </button>;
} }
@ -122,25 +124,27 @@ export default class BugReportDialog extends React.Component {
return ( return (
<div className="mx_BugReportDialog"> <div className="mx_BugReportDialog">
<div className="mx_Dialog_title"> <div className="mx_Dialog_title">
Report a bug { _t("Report a bug") }
</div> </div>
<div className="mx_Dialog_content"> <div className="mx_Dialog_content">
<p>Please describe the bug. What did you do? <p>
What did you expect to happen? { _t("Please describe the bug. What did you do? What did you expect to happen? What actually happened?") }
What actually happened?</p> </p>
<textarea <textarea
className="mx_BugReportDialog_input" className="mx_BugReportDialog_input"
rows={5} rows={5}
onChange={this._onTextChange} onChange={this._onTextChange}
value={this.state.text} value={this.state.text}
placeholder="Describe your problem here." placeholder={_t("Describe your problem here.")}
/> />
<p>In order to diagnose problems, logs from this client will be sent with <p>
this bug report. { _t("In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:") }
If you would prefer to only send the text above, please untick:</p> </p>
<input type="checkbox" checked={this.state.sendLogs} <input type="checkbox" checked={this.state.sendLogs}
onChange={this._onSendLogsChange} id="mx_BugReportDialog_logs"/> onChange={this._onSendLogsChange} id="mx_BugReportDialog_logs"/>
<label htmlFor="mx_BugReportDialog_logs">Send logs</label> <label htmlFor="mx_BugReportDialog_logs">
{ _t("Send logs") }
</label>
{progress} {progress}
{error} {error}
</div> </div>
@ -151,7 +155,7 @@ export default class BugReportDialog extends React.Component {
autoFocus={true} autoFocus={true}
disabled={this.state.busy} disabled={this.state.busy}
> >
Send { _t("Send") }
</button> </button>
{cancelButton} {cancelButton}

View File

@ -17,6 +17,7 @@
import React from 'react'; import React from 'react';
import sdk from 'matrix-react-sdk'; import sdk from 'matrix-react-sdk';
import request from 'browser-request'; import request from 'browser-request';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
const REPOS = ['vector-im/vector-web', 'matrix-org/matrix-react-sdk', 'matrix-org/matrix-js-sdk']; const REPOS = ['vector-im/vector-web', 'matrix-org/matrix-react-sdk', 'matrix-org/matrix-js-sdk'];
@ -70,16 +71,16 @@ export default class ChangelogDialog extends React.Component {
const content = ( const content = (
<div className="mx_ChangelogDialog_content"> <div className="mx_ChangelogDialog_content">
{this.props.version == null || this.props.newVersion == null ? <h2>Unavailable</h2> : logs} {this.props.version == null || this.props.newVersion == null ? <h2>{_t("Unavailable")}</h2> : logs}
</div> </div>
); );
return ( return (
<QuestionDialog <QuestionDialog
title="Changelog" title={_t("Changelog")}
description={content} description={content}
button="Update" button={_t("Update")}
onFinished={this.props.onFinished} onFinished={this.props.onFinished}
/> />
) )

View File

@ -7,8 +7,10 @@
"All notifications are currently disabled for all targets.": "All notifications are currently disabled for all targets.", "All notifications are currently disabled for all targets.": "All notifications are currently disabled for all targets.",
"An error occurred whilst saving your email notification preferences.": "An error occurred whilst saving your email notification preferences.", "An error occurred whilst saving your email notification preferences.": "An error occurred whilst saving your email notification preferences.",
"Call invitation": "Call invitation", "Call invitation": "Call invitation",
"Cancel": "Cancel",
"Cancel Sending": "Cancel Sending", "Cancel Sending": "Cancel Sending",
"Can't update user notification settings": "Can't update user notification settings", "Can't update user notification settings": "Can't update user notification settings",
"Changelog": "Changelog",
"Close": "Close", "Close": "Close",
"Collapse panel": "Collapse panel", "Collapse panel": "Collapse panel",
"Create new room": "Create new room", "Create new room": "Create new room",
@ -17,6 +19,7 @@
"customServer_text": "You can use the custom server options to sign into other Matrix servers by specifying a different Home server URL.<br/>This allows you to use Riot with an existing Matrix account on a different home server.<br/><br/>You can also set a custom identity server but you won't be able to invite users by email address, or be invited by email address yourself.", "customServer_text": "You can use the custom server options to sign into other Matrix servers by specifying a different Home server URL.<br/>This allows you to use Riot with an existing Matrix account on a different home server.<br/><br/>You can also set a custom identity server but you won't be able to invite users by email address, or be invited by email address yourself.",
"delete the alias": "delete the alias", "delete the alias": "delete the alias",
"Delete the room alias %(alias)s and remove %(name)s from the directory?": "Delete the room alias %(alias)s and remove %(name)s from the directory?", "Delete the room alias %(alias)s and remove %(name)s from the directory?": "Delete the room alias %(alias)s and remove %(name)s from the directory?",
"Describe your problem here.": "Describe your problem here.",
"Direct Chat": "Direct Chat", "Direct Chat": "Direct Chat",
"Directory": "Directory", "Directory": "Directory",
"Dismiss": "Dismiss", "Dismiss": "Dismiss",
@ -41,6 +44,7 @@
"Failed to get public room list": "Failed to get public room list", "Failed to get public room list": "Failed to get public room list",
"Failed to join the room": "Failed to join the room", "Failed to join the room": "Failed to join the room",
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room", "Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
"Failed to send report: ": "Failed to send report: ",
"Failed to set direct chat tag": "Failed to set direct chat tag", "Failed to set direct chat tag": "Failed to set direct chat tag",
"Failed to set Direct Message status of room": "Failed to set Direct Message status of room", "Failed to set Direct Message status of room": "Failed to set Direct Message status of room",
"Favourite": "Favourite", "Favourite": "Favourite",
@ -48,13 +52,16 @@
"Files": "Files", "Files": "Files",
"Filter room names": "Filter room names", "Filter room names": "Filter room names",
"Forget": "Forget", "Forget": "Forget",
"Forward Message": "Forward Message",
" from room": " from room", " from room": " from room",
"Guests can join": "Guests can join", "Guests can join": "Guests can join",
"Guest users can't invite users. Please register to invite": "Guest users can't invite users. Please register to invite", "Guest users can't invite users. Please register to invite": "Guest users can't invite users. Please register to invite",
"I understand the risks and wish to continue": "I understand the risks and wish to continue", "I understand the risks and wish to continue": "I understand the risks and wish to continue",
"In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:": "In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:",
"Invite to this room": "Invite to this room", "Invite to this room": "Invite to this room",
"Keywords": "Keywords", "Keywords": "Keywords",
"Leave": "Leave", "Leave": "Leave",
"Loading bug report module": "Loading bug report module",
"Low Priority": "Low Priority", "Low Priority": "Low Priority",
"Members": "Members", "Members": "Members",
"Mentions only": "Mentions only", "Mentions only": "Mentions only",
@ -77,6 +84,8 @@
"On": "On", "On": "On",
"Operation failed": "Operation failed", "Operation failed": "Operation failed",
"Permalink": "Permalink", "Permalink": "Permalink",
"Please describe the bug. What did you do? What did you expect to happen? What actually happened?": "Please describe the bug. What did you do? What did you expect to happen? What actually happened?",
"Please describe the bug and/or send logs.": "Please describe the bug and/or send logs.",
"Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.": "Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.", "Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.": "Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.",
"Please Register": "Please Register", "Please Register": "Please Register",
"powered by Matrix": "powered by Matrix", "powered by Matrix": "powered by Matrix",
@ -87,12 +96,15 @@
"Remove": "Remove", "Remove": "Remove",
"remove %(name)s from the directory": "remove %(name)s from the directory", "remove %(name)s from the directory": "remove %(name)s from the directory",
"Remove from Directory": "Remove from Directory", "Remove from Directory": "Remove from Directory",
"Report a bug": "Report a bug",
"Resend": "Resend", "Resend": "Resend",
"Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network", "Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network",
"Riot uses many advanced browser features, some of which are not available or experimental in your current browser.": "Riot uses many advanced browser features, some of which are not available or experimental in your current browser.", "Riot uses many advanced browser features, some of which are not available or experimental in your current browser.": "Riot uses many advanced browser features, some of which are not available or experimental in your current browser.",
"Room directory": "Room directory", "Room directory": "Room directory",
"Room not found": "Room not found", "Room not found": "Room not found",
"Search for a room": "Search for a room", "Search for a room": "Search for a room",
"Send": "Send",
"Send logs": "Send logs",
"Settings": "Settings", "Settings": "Settings",
"Source URL": "Source URL", "Source URL": "Source URL",
"Sorry, your browser is <b>not</b> able to run Riot.": "Sorry, your browser is <b>not</b> able to run Riot.", "Sorry, your browser is <b>not</b> able to run Riot.": "Sorry, your browser is <b>not</b> able to run Riot.",
@ -105,9 +117,11 @@
"Unable to fetch notification target list": "Unable to fetch notification target list", "Unable to fetch notification target list": "Unable to fetch notification target list",
"Unable to join network": "Unable to join network", "Unable to join network": "Unable to join network",
"Unable to look up room ID from server": "Unable to look up room ID from server", "Unable to look up room ID from server": "Unable to look up room ID from server",
"Unavailable": "Unavailable",
"Unhide Preview": "Unhide Preview", "Unhide Preview": "Unhide Preview",
"unknown error code": "unknown error code", "unknown error code": "unknown error code",
"Unnamed room": "Unnamed room", "Unnamed room": "Unnamed room",
"Update": "Update",
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s", "Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
"View Decrypted Source": "View Decrypted Source", "View Decrypted Source": "View Decrypted Source",
"View Source": "View Source", "View Source": "View Source",