i18nize all the things and change show logic
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
04b86e5d1d
commit
dbba1dedb6
2 changed files with 16 additions and 12 deletions
|
@ -902,9 +902,7 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_mapWebRtcDevicesToSpans: function(devices) {
|
_mapWebRtcDevicesToSpans: function(devices) {
|
||||||
return Object.keys(devices).map(
|
return Object.keys(devices).map((deviceId) => <span key={deviceId}>{devices[deviceId]}</span>);
|
||||||
(deviceId) => <span key={deviceId}>{devices[deviceId]}</span>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_setAudioInput: function(deviceId) {
|
_setAudioInput: function(deviceId) {
|
||||||
|
@ -928,8 +926,8 @@ module.exports = React.createClass({
|
||||||
function() {
|
function() {
|
||||||
const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog');
|
const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog');
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
title: "No media permissions",
|
title: _t('No media permissions'),
|
||||||
description: "You may need to manually permit Riot to access your microphone/webcam",
|
description: _t('You may need to manually permit Riot to access your microphone/webcam'),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
@ -939,10 +937,10 @@ module.exports = React.createClass({
|
||||||
_renderWebRtcSettings: function() {
|
_renderWebRtcSettings: function() {
|
||||||
if (this.state.mediaDevices === false) {
|
if (this.state.mediaDevices === false) {
|
||||||
return <div>
|
return <div>
|
||||||
<h3>WebRTC</h3>
|
<h3>{_t('VoIP')}</h3>
|
||||||
<div className="mx_UserSettings_section">
|
<div className="mx_UserSettings_section">
|
||||||
<p className="mx_UserSettings_link" onClick={this._requestMediaPermissions}>
|
<p className="mx_UserSettings_link" onClick={this._requestMediaPermissions}>
|
||||||
Missing Media Permissions, click here to request.
|
{_t('Missing Media Permissions, click here to request.')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
|
@ -950,11 +948,11 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
const Dropdown = sdk.getComponent('elements.Dropdown');
|
const Dropdown = sdk.getComponent('elements.Dropdown');
|
||||||
|
|
||||||
let microphoneDropdown = <p>No Microphones detected</p>;
|
let microphoneDropdown = <p>{_t('No Microphones detected')}</p>;
|
||||||
let webcamDropdown = <p>No Webcams detected</p>;
|
let webcamDropdown = <p>{_t('No Webcams detected')}</p>;
|
||||||
|
|
||||||
const audioInputs = this.state.mediaDevices.audioinput;
|
const audioInputs = this.state.mediaDevices.audioinput;
|
||||||
if ('default' in audioInputs) {
|
if (Object.keys(videoInputs).length > 0) {
|
||||||
microphoneDropdown = <div>
|
microphoneDropdown = <div>
|
||||||
<h4>Microphone</h4>
|
<h4>Microphone</h4>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
|
@ -967,7 +965,7 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
const videoInputs = this.state.mediaDevices.videoinput;
|
const videoInputs = this.state.mediaDevices.videoinput;
|
||||||
if ('default' in videoInputs) {
|
if (Object.keys(videoInputs).length > 0) {
|
||||||
webcamDropdown = <div>
|
webcamDropdown = <div>
|
||||||
<h4>Cameras</h4>
|
<h4>Cameras</h4>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
|
@ -980,7 +978,7 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<h3>WebRTC</h3>
|
<h3>{_t('VoIP')}</h3>
|
||||||
<div className="mx_UserSettings_section">
|
<div className="mx_UserSettings_section">
|
||||||
{microphoneDropdown}
|
{microphoneDropdown}
|
||||||
{webcamDropdown}
|
{webcamDropdown}
|
||||||
|
|
|
@ -129,6 +129,12 @@
|
||||||
"Add email address": "Add email address",
|
"Add email address": "Add email address",
|
||||||
"Add phone number": "Add phone number",
|
"Add phone number": "Add phone number",
|
||||||
"Admin": "Admin",
|
"Admin": "Admin",
|
||||||
|
"VoIP": "VoIP",
|
||||||
|
"Missing Media Permissions, click here to request.": "Missing Media Permissions, click here to request.",
|
||||||
|
"No Microphones detected": "No Microphones detected",
|
||||||
|
"No Webcams detected": "No Webcams detected",
|
||||||
|
"No media permissions": "No media permissions",
|
||||||
|
"You may need to manually permit Riot to access your microphone/webcam": "You may need to manually permit Riot to access your microphone/webcam",
|
||||||
"Advanced": "Advanced",
|
"Advanced": "Advanced",
|
||||||
"Algorithm": "Algorithm",
|
"Algorithm": "Algorithm",
|
||||||
"Always show message timestamps": "Always show message timestamps",
|
"Always show message timestamps": "Always show message timestamps",
|
||||||
|
|
Loading…
Reference in a new issue