From dbba1dedb6a529ce1198f2b2d85ec8e7b046c981 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Jun 2017 22:58:17 +0100 Subject: [PATCH] i18nize all the things and change show logic Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/UserSettings.js | 22 ++++++++++------------ src/i18n/strings/en_EN.json | 6 ++++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 4cb49d8c1e..b33bdd271d 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -902,9 +902,7 @@ module.exports = React.createClass({ }, _mapWebRtcDevicesToSpans: function(devices) { - return Object.keys(devices).map( - (deviceId) => {devices[deviceId]} - ); + return Object.keys(devices).map((deviceId) => {devices[deviceId]}); }, _setAudioInput: function(deviceId) { @@ -928,8 +926,8 @@ module.exports = React.createClass({ function() { const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog'); Modal.createDialog(ErrorDialog, { - title: "No media permissions", - description: "You may need to manually permit Riot to access your microphone/webcam", + title: _t('No media permissions'), + description: _t('You may need to manually permit Riot to access your microphone/webcam'), }); }, ]); @@ -939,10 +937,10 @@ module.exports = React.createClass({ _renderWebRtcSettings: function() { if (this.state.mediaDevices === false) { return
- Missing Media Permissions, click here to request. + {_t('Missing Media Permissions, click here to request.')}
No Microphones detected
; - let webcamDropdown =No Webcams detected
; + let microphoneDropdown ={_t('No Microphones detected')}
; + let webcamDropdown ={_t('No Webcams detected')}
; const audioInputs = this.state.mediaDevices.audioinput; - if ('default' in audioInputs) { + if (Object.keys(videoInputs).length > 0) { microphoneDropdown =