Merge branch 'develop' into new-guest-access

This commit is contained in:
David Baker 2017-06-06 11:39:47 +01:00
commit e30fcdba4c
57 changed files with 2000 additions and 296 deletions

View file

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

View file

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

View file

@ -17,6 +17,7 @@
import React from 'react';
import sdk from 'matrix-react-sdk';
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'];
@ -70,16 +71,16 @@ export default class ChangelogDialog extends React.Component {
const 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>
);
return (
<QuestionDialog
title="Changelog"
title={_t("Changelog")}
description={content}
button="Update"
button={_t("Update")}
onFinished={this.props.onFinished}
/>
)

View file

@ -20,6 +20,7 @@ import React from 'react';
import sdk from 'matrix-react-sdk';
import Modal from 'matrix-react-sdk/lib/Modal';
import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
/**
* Check a version string is compatible with the Changelog
@ -40,9 +41,9 @@ export default React.createClass({
displayReleaseNotes: function(releaseNotes) {
const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog');
Modal.createDialog(QuestionDialog, {
title: "What's New",
title: _t("What's New"),
description: <pre className="changelog_text">{releaseNotes}</pre>,
button: "Update",
button: _t("Update"),
onFinished: (update) => {
if(update && PlatformPeg.get()) {
PlatformPeg.get().installUpdate();
@ -75,17 +76,29 @@ export default React.createClass({
// automatically tells you what's changed (provided the versions
// are in the right format)
if (this.props.releaseNotes) {
action_button = <button className="mx_MatrixToolbar_action" onClick={this.displayReleaseNotes}>What's new?</button>;
action_button = (
<button className="mx_MatrixToolbar_action" onClick={this.displayReleaseNotes}>
{ _t("What's new?") }
</button>
);
} else if (checkVersion(this.props.version) && checkVersion(this.props.newVersion)) {
action_button = <button className="mx_MatrixToolbar_action" onClick={this.displayChangelog}>What's new?</button>;
action_button = (
<button className="mx_MatrixToolbar_action" onClick={this.displayChangelog}>
{ _t("What's new?") }
</button>
);
} else if (PlatformPeg.get()) {
action_button = <button className="mx_MatrixToolbar_action" onClick={this.onUpdateClicked}>Update</button>;
action_button = (
<button className="mx_MatrixToolbar_action" onClick={this.onUpdateClicked}>
{ _t("Update") }
</button>
);
}
return (
<div className="mx_MatrixToolbar">
<img className="mx_MatrixToolbar_warning" src="img/warning.svg" width="24" height="23" alt="/!\"/>
<div className="mx_MatrixToolbar_content">
A new version of Riot is available.
{_t("A new version of Riot is available.")}
</div>
{action_button}
</div>

View file

@ -15,6 +15,7 @@ limitations under the License.
*/
var React = require("react");
var sanitizeHtml = require("sanitize-html");
import { _t } from 'matrix-react-sdk/lib/languageHandler';
module.exports = React.createClass({
@ -30,7 +31,7 @@ module.exports = React.createClass({
{ _t('Custom Server Options') }
</div>
<div className="mx_Dialog_content">
<span dangerouslySetInnerHTML={{__html: _t('customServer_text')}} />
<span dangerouslySetInnerHTML={{__html: sanitizeHtml(_t('customServer_text'))}} />
</div>
<div className="mx_Dialog_buttons">
<button onClick={this.props.onFinished} autoFocus={true}>

View file

@ -49,7 +49,7 @@ module.exports = React.createClass({
label = days[date.getDay()];
}
else {
label = DateUtils.formatFullDate(date);
label = DateUtils.formatFullDate(date, this.props.showTwelveHour);
}
return (

View file

@ -21,6 +21,7 @@ var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
var sdk = require('matrix-react-sdk');
var classNames = require('classnames');
var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton');
import { _t } from "matrix-react-sdk/lib/languageHandler";
module.exports = React.createClass({
displayName: 'SearchBar',
@ -59,10 +60,10 @@ module.exports = React.createClass({
return (
<div className="mx_SearchBar">
<input ref="search_term" className="mx_SearchBar_input" type="text" autoFocus={true} placeholder="Search..." onKeyDown={this.onSearchChange}/>
<AccessibleButton className={ searchButtonClasses } onClick={this.onSearch}><img src="img/search-button.svg" width="37" height="37" alt="Search"/></AccessibleButton>
<AccessibleButton className={ thisRoomClasses } onClick={this.onThisRoomClick}>This Room</AccessibleButton>
<AccessibleButton className={ allRoomsClasses } onClick={this.onAllRoomsClick}>All Rooms</AccessibleButton>
<input ref="search_term" className="mx_SearchBar_input" type="text" autoFocus={true} placeholder={_t("Search…")} onKeyDown={this.onSearchChange}/>
<AccessibleButton className={ searchButtonClasses } onClick={this.onSearch}><img src="img/search-button.svg" width="37" height="37" alt={_t("Search")}/></AccessibleButton>
<AccessibleButton className={ thisRoomClasses } onClick={this.onThisRoomClick}>{_t("This Room")}</AccessibleButton>
<AccessibleButton className={ allRoomsClasses } onClick={this.onAllRoomsClick}>{_t("All Rooms")}</AccessibleButton>
<AccessibleButton className="mx_SearchBar_cancel" onClick={this.props.onCancelClick}><img src="img/cancel.svg" width="18" height="18" /></AccessibleButton>
</div>
);