add i18n
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
78aa0a59de
commit
a437f23e9d
2 changed files with 27 additions and 16 deletions
|
@ -16,6 +16,7 @@ limitations under the License.
|
|||
|
||||
import React from 'react';
|
||||
import sdk from 'matrix-react-sdk';
|
||||
import { _t } from 'matrix-react-sdk/lib/languageHandler';
|
||||
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
|
||||
|
||||
class SendCustomEvent extends React.Component {
|
||||
|
@ -44,8 +45,8 @@ class SendCustomEvent extends React.Component {
|
|||
|
||||
_buttons() {
|
||||
return <div className="mx_Dialog_buttons">
|
||||
<button onClick={this.onBack}>Back</button>
|
||||
{!this.state.message && <button onClick={this._send}>Send</button>}
|
||||
<button onClick={this.onBack}>{ _t('Back') }</button>
|
||||
{!this.state.message && <button onClick={this._send}>{ _t('Send') }</button>}
|
||||
</div>;
|
||||
}
|
||||
|
||||
|
@ -58,9 +59,9 @@ class SendCustomEvent extends React.Component {
|
|||
try {
|
||||
const content = JSON.parse(this.refs.evContent.value);
|
||||
await this.send(content);
|
||||
message = 'Event sent!';
|
||||
message = _t('Event sent!');
|
||||
} catch (e) {
|
||||
message = 'Failed to send custom event.' + ` (${e.toString()})`;
|
||||
message = `${_t('Failed to send custom event.')} (${e.toString()})`;
|
||||
}
|
||||
this.setState({ message });
|
||||
}
|
||||
|
@ -78,14 +79,14 @@ class SendCustomEvent extends React.Component {
|
|||
return <div>
|
||||
<div className="mx_Dialog_content">
|
||||
<div className="mx_TextInputDialog_label">
|
||||
<label htmlFor="eventType"> Event Type </label>
|
||||
<label htmlFor="eventType"> { _t('Event Type') } </label>
|
||||
</div>
|
||||
<div>
|
||||
<input id="eventType" ref="eventType" className="mx_TextInputDialog_input" size="64" />
|
||||
</div>
|
||||
|
||||
<div className="mx_TextInputDialog_label">
|
||||
<label htmlFor="evContent"> Event Content </label>
|
||||
<label htmlFor="evContent"> { _t('Event Content') } </label>
|
||||
</div>
|
||||
<div>
|
||||
<textarea id="evContent" ref="evContent" className="mx_TextInputDialog_input" defaultValue={"{\n\n}"} cols="63" rows="5" />
|
||||
|
@ -115,21 +116,21 @@ class SendCustomStateEvent extends SendCustomEvent {
|
|||
return <div>
|
||||
<div className="mx_Dialog_content">
|
||||
<div className="mx_TextInputDialog_label">
|
||||
<label htmlFor="stateKey"> State Key </label>
|
||||
<label htmlFor="stateKey"> { _t('State Key') } </label>
|
||||
</div>
|
||||
<div>
|
||||
<input id="stateKey" ref="stateKey" className="mx_TextInputDialog_input" size="64" />
|
||||
</div>
|
||||
|
||||
<div className="mx_TextInputDialog_label">
|
||||
<label htmlFor="eventType"> Event Type </label>
|
||||
<label htmlFor="eventType"> { _t('Event Type') } </label>
|
||||
</div>
|
||||
<div>
|
||||
<input id="eventType" ref="eventType" className="mx_TextInputDialog_input" size="64" />
|
||||
</div>
|
||||
|
||||
<div className="mx_TextInputDialog_label">
|
||||
<label htmlFor="evContent"> Event Content </label>
|
||||
<label htmlFor="evContent"> { _t('Event Content') } </label>
|
||||
</div>
|
||||
<div>
|
||||
<textarea id="evContent" ref="evContent" className="mx_TextInputDialog_input" defaultValue={"{\n\n}"} cols="63" rows="5" />
|
||||
|
@ -191,7 +192,7 @@ class RoomStateExplorer extends React.Component {
|
|||
<pre>{JSON.stringify(this.state.event, null, 2)}</pre>
|
||||
</div>
|
||||
<div className="mx_Dialog_buttons">
|
||||
<button onClick={this.onBack}>Back</button>
|
||||
<button onClick={this.onBack}>{ _t('Back') }</button>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
@ -226,7 +227,7 @@ class RoomStateExplorer extends React.Component {
|
|||
{rows}
|
||||
</div>
|
||||
<div className="mx_Dialog_buttons">
|
||||
<button onClick={this.onBack}>Back</button>
|
||||
<button onClick={this.onBack}>{ _t('Back') }</button>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
@ -274,18 +275,18 @@ export default class DevtoolsDialog extends React.Component {
|
|||
} else {
|
||||
body = <div>
|
||||
<div className="mx_Dialog_content">
|
||||
<button onClick={this._setMode(SendCustomEvent)}>Send Custom Event</button>
|
||||
<button onClick={this._setMode(SendCustomStateEvent)}>Send Custom State Event</button>
|
||||
<button onClick={this._setMode(RoomStateExplorer)}>Explore Room State</button>
|
||||
<button onClick={this._setMode(SendCustomEvent)}>{ _t('Send Custom Event') }</button>
|
||||
<button onClick={this._setMode(SendCustomStateEvent)}>{ _t('Send Custom State Event') }</button>
|
||||
<button onClick={this._setMode(RoomStateExplorer)}>{ _t('Explore Room State') }</button>
|
||||
</div>
|
||||
<div className="mx_Dialog_buttons">
|
||||
<button onClick={this.onCancel}>Cancel</button>
|
||||
<button onClick={this.onCancel}>{ _t('Cancel') }</button>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
||||
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||
return <BaseDialog className="mx_QuestionDialog" onFinished={this.props.onFinished} title="Developer Tools">
|
||||
return <BaseDialog className="mx_QuestionDialog" onFinished={this.props.onFinished} title={_t('Developer Tools')}>
|
||||
<div>Room ID: {this.props.roomId}</div>
|
||||
{ body }
|
||||
</BaseDialog>;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"All Rooms": "All Rooms",
|
||||
"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.",
|
||||
"Back": "Back",
|
||||
"Call invitation": "Call invitation",
|
||||
"Cancel": "Cancel",
|
||||
"Cancel Sending": "Cancel Sending",
|
||||
|
@ -25,6 +26,7 @@
|
|||
"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?",
|
||||
"Describe your problem here.": "Describe your problem here.",
|
||||
"Developer Tools": "Developer Tools",
|
||||
"Direct Chat": "Direct Chat",
|
||||
"Directory": "Directory",
|
||||
"Dismiss": "Dismiss",
|
||||
|
@ -49,6 +51,7 @@
|
|||
"Failed to get public room list": "Failed to get public room list",
|
||||
"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 send custom event.": "Failed to send custom event.",
|
||||
"Failed to send report: ": "Failed to send report: ",
|
||||
"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",
|
||||
|
@ -116,6 +119,9 @@
|
|||
"Search for a room": "Search for a room",
|
||||
"Send": "Send",
|
||||
"Send logs": "Send logs",
|
||||
"Send Custom Event": "Send Custom Event",
|
||||
"Send Custom State Event": "Send Custom State Event",
|
||||
"Explore Room State": "Explore Room State",
|
||||
"Settings": "Settings",
|
||||
"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.",
|
||||
|
@ -162,6 +168,10 @@
|
|||
"Warning": "Warning",
|
||||
"Checking for an update...": "Checking for an update...",
|
||||
"Error encountered (%(errorDetail)s).": "Error encountered (%(errorDetail)s).",
|
||||
"Event sent!": "Event sent!",
|
||||
"Event Type": "Event Type",
|
||||
"Event Content": "Event Content",
|
||||
"State Key": "State Key",
|
||||
"No update available.": "No update available.",
|
||||
"Downloading update...": "Downloading update...",
|
||||
"You need to be using HTTPS to place a screen-sharing call.": "You need to be using HTTPS to place a screen-sharing call.",
|
||||
|
|
Loading…
Reference in a new issue