How to use the matrix-react-sdk/lib/languageHandler._t function in matrix-react-sdk

To help you get started, we’ve selected a few matrix-react-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vector-im / riot-web / src / components / views / rooms / DNDRoomTile.js View on Github external
}).catch(function(err) {
                    var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
                    console.error("Failed to remove tag " + prevTag + " from room: " + err);
                    Modal.createTrackedDialog('Failed to remove tag from room', '', ErrorDialog, {
                        title: _t('Failed to remove tag %(tagName)s from room', {tagName: prevTag}),
                        description: ((err && err.message) ? err.message : _t('Operation failed')),
                    });
                });
            }
github vector-im / riot-web / src / components / structures / HomePage.js View on Github external
                    body = body.replace(/_t\(['"]([\s\S]*?)['"]\)/mg, (match, g1)=>{ return sanitizeHtml(_t(g1)) });
                    this.setState({ page: body });
github vector-im / riot-web / src / components / views / rooms / PinnedEventsPanel.js View on Github external
const MemberAvatar = sdk.getComponent("views.avatars.MemberAvatar");

        const sender = this.props.mxRoom.getMember(this.props.mxEvent.getSender());
        const avatarSize = 40;

        let unpinButton = null;
        if (this._canUnpin()) {
            unpinButton = <img title="{_t('Unpin" alt="{_t('Unpin" height="8" width="8" src="img/cancel-red.svg">;
        }

        return (
            <div>
                <div>
                    
                        { _t("Jump to message") }
                    
                    { unpinButton }
                </div>

                
                <span>
                    {sender.name}
                </span>
                
            </div>
        );
    }
});
github vector-im / riot-web / src / components / views / auth / VectorCustomServerDialog.js View on Github external
module.exports = ({onFinished}) =&gt; {
    return (
        <div>
            <div>
                { _t('Custom Server Options') }
            </div>
            <div>
                <p>{_t(
                    "You can use the custom server options to sign into other " +
                    "Matrix servers by specifying a different homeserver URL. This " +
                    "allows you to use Riot with an existing Matrix account on a " +
                    "different homeserver.",
                )}</p>
            </div>
            <div>
                <button>
                    { _t('Dismiss') }
                </button>
            </div>
        </div>
    );
github vector-im / riot-web / src / vector / platform / VectorBasePlatform.js View on Github external
getDefaultDeviceDisplayName(): string {
        return _t("Unknown device");
    }
}
github vector-im / riot-web / src / components / views / messages / DateSeparator.js View on Github external
function getdaysArray() {
	return [
        _t('Sunday'),
        _t('Monday'),
        _t('Tuesday'),
        _t('Wednesday'),
        _t('Thursday'),
        _t('Friday'),
        _t('Saturday'),
    ];
}
github vector-im / riot-web / src / components / views / rooms / PinnedEventsPanel.js View on Github external
render: function() {
        let tiles = <div>{ _t("Loading...") }</div>;
        if (this.state &amp;&amp; !this.state.loading) {
            tiles = this._getPinnedTiles();
        }

        return (
            <div>
                <div>
                    <img height="18" width="18" src="img/cancel.svg">
                    <h3>{_t("Pinned Messages")}</h3>
                    { tiles }
                </div>
            </div>
        );
    }
});
github vector-im / riot-web / src / components / views / dialogs / DevtoolsDialog.js View on Github external
render() {
        if (this.state.message) {
            return <div>
                <div>
                    { this.state.message }
                </div>
                { this._buttons() }
            </div>;
        }

        return <div>
            <div>
                { this.textInput('eventType', _t('Event Type')) }
                { this.state.isStateEvent &amp;&amp; this.textInput('stateKey', _t('State Key')) }

                <br>

                <div>
                    <label> { _t('Event Content') } </label>
                </div>
                <div>
                    <textarea rows="5" cols="63" value="{this.state.evContent}" id="evContent">                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div className="mx_Dialog_buttons"&gt;
                &lt;button onClick={this.onBack}&gt;{ _t('Back') }&lt;/button&gt;
                { !this.state.message &amp;&amp; &lt;button onClick={this._send}&gt;{ _t('Send') }&lt;/button&gt; }
                { !this.state.message &amp;&amp; !this.props.forceStateEvent &amp;&amp; &lt;div style={{float: "right"}}&gt;
                    &lt;input id="isStateEvent" className="mx_DevTools_tgl mx_DevTools_tgl-flip" type="checkbox" onChange={this._onChange} checked={this.state.isStateEvent} /&gt;</textarea></div></div></div>
github vector-im / riot-web / src / components / views / dialogs / DevtoolsDialog.js View on Github external
<div>
                    { this.state.message }
                </div>
                { this._buttons() }
            ;
        }

        return <div>
            <div>
                { this.textInput('eventType', _t('Event Type')) }
                { this.state.isStateEvent &amp;&amp; this.textInput('stateKey', _t('State Key')) }

                <br>

                <div>
                    <label> { _t('Event Content') } </label>
                </div>
                <div>
                    <textarea rows="5" cols="63" value="{this.state.evContent}" id="evContent">                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div className="mx_Dialog_buttons"&gt;
                &lt;button onClick={this.onBack}&gt;{ _t('Back') }&lt;/button&gt;
                { !this.state.message &amp;&amp; &lt;button onClick={this._send}&gt;{ _t('Send') }&lt;/button&gt; }
                { !this.state.message &amp;&amp; !this.props.forceStateEvent &amp;&amp; &lt;div style={{float: "right"}}&gt;
                    &lt;input id="isStateEvent" className="mx_DevTools_tgl mx_DevTools_tgl-flip" type="checkbox" onChange={this._onChange} checked={this.state.isStateEvent} /&gt;
                    &lt;label className="mx_DevTools_tgl-btn" data-tg-off="Event" data-tg-on="State Event" htmlFor="isStateEvent" /&gt;
                &lt;/div&gt; }
            &lt;/div&gt;
        &lt;/div&gt;;
    }
}</textarea></div></div></div>