Browse Source

Include support for translated string resources at device permission dialog because it contains hardcoded english strings.

j8
Victor de Francisco 4 years ago
parent
commit
d4c7fc8a72
3 changed files with 13 additions and 13 deletions
  1. 3
    0
      lang/main-es.json
  2. 3
    0
      lang/main.json
  3. 7
    13
      react/features/mobile/permissions/middleware.js

+ 3
- 0
lang/main-es.json View File

257
         "passwordNotSupported": "No se soporta $t(lockRoomPassword) en la reunión",
257
         "passwordNotSupported": "No se soporta $t(lockRoomPassword) en la reunión",
258
         "passwordNotSupportedTitle": "$t(lockRoomPasswordUppercase) no es compatible",
258
         "passwordNotSupportedTitle": "$t(lockRoomPasswordUppercase) no es compatible",
259
         "passwordRequired": "$t(lockRoomPasswordUppercase) necesario",
259
         "passwordRequired": "$t(lockRoomPasswordUppercase) necesario",
260
+        "permissionErrorTitle": "Permiso necesario",
261
+        "permissionCameraRequiredError": "El permiso de cámara es necesario para participar en conferencias con vídeo. Por favor, permítelo en Ajustes",
262
+        "permissionMicRequiredError": "El permiso de micrófono es necesario para participar en conferencias con sonido. Por favor, permítelo en Ajustes",
260
         "popupError": "Su navegador está bloqueando las ventanas emergentes de este sitio. Habilite las ventanas emergentes en la configuración de seguridad de su navegador y vuelva a intentarlo.",
263
         "popupError": "Su navegador está bloqueando las ventanas emergentes de este sitio. Habilite las ventanas emergentes en la configuración de seguridad de su navegador y vuelva a intentarlo.",
261
         "popupErrorTitle": "Ventana emergente bloqueada",
264
         "popupErrorTitle": "Ventana emergente bloqueada",
262
         "readMore": "mas",
265
         "readMore": "mas",

+ 3
- 0
lang/main.json View File

267
         "passwordNotSupported": "Setting a meeting $t(lockRoomPassword) is not supported.",
267
         "passwordNotSupported": "Setting a meeting $t(lockRoomPassword) is not supported.",
268
         "passwordNotSupportedTitle": "$t(lockRoomPasswordUppercase) not supported",
268
         "passwordNotSupportedTitle": "$t(lockRoomPasswordUppercase) not supported",
269
         "passwordRequired": "$t(lockRoomPasswordUppercase) required",
269
         "passwordRequired": "$t(lockRoomPasswordUppercase) required",
270
+        "permissionErrorTitle": "Permission required",
271
+        "permissionCameraRequiredError": "Camera permission is required to participate in conferences with video. Please grant it in Settings",
272
+        "permissionMicRequiredError": "Microphone permission is required to participate in conferences with audio. Please grant it in Settings",
270
         "popupError": "Your browser is blocking pop-up windows from this site. Please enable pop-ups in your browser's security settings and try again.",
273
         "popupError": "Your browser is blocking pop-up windows from this site. Please enable pop-ups in your browser's security settings and try again.",
271
         "popupErrorTitle": "Pop-up blocked",
274
         "popupErrorTitle": "Pop-up blocked",
272
         "readMore": "more",
275
         "readMore": "more",

+ 7
- 13
react/features/mobile/permissions/middleware.js View File

2
 
2
 
3
 import { Alert } from 'react-native';
3
 import { Alert } from 'react-native';
4
 
4
 
5
-
6
 import { isRoomValid } from '../../base/conference';
5
 import { isRoomValid } from '../../base/conference';
6
+import { i18next } from '../../base/i18n';
7
 import { MiddlewareRegistry } from '../../base/redux';
7
 import { MiddlewareRegistry } from '../../base/redux';
8
 import { TRACK_CREATE_ERROR } from '../../base/tracks';
8
 import { TRACK_CREATE_ERROR } from '../../base/tracks';
9
 
9
 
48
  * @returns {void}
48
  * @returns {void}
49
  */
49
  */
50
 function _alertPermissionErrorWithSettings(trackType) {
50
 function _alertPermissionErrorWithSettings(trackType) {
51
-    // TODO i18n
52
-    const deviceType = trackType === 'video' ? 'Camera' : 'Microphone';
53
-
54
     /* eslint-disable indent */
51
     /* eslint-disable indent */
55
-
56
-    const message
57
-        = `${deviceType
58
-            } permission is required to participate in conferences with ${
59
-            trackType}. Please grant it in Settings.`;
60
-
52
+    const message = trackType === 'video'
53
+        ? i18next.t('dialog.permissionCameraRequiredError')
54
+        : i18next.t('dialog.permissionMicRequiredError');
61
     /* eslint-ensable indent */
55
     /* eslint-ensable indent */
62
 
56
 
63
     Alert.alert(
57
     Alert.alert(
64
-        'Permission required',
58
+        i18next.t('dialog.permissionErrorTitle'),
65
         message,
59
         message,
66
         [
60
         [
67
-            { text: 'Cancel' },
61
+            { text: i18next.t('dialog.Cancel') },
68
             {
62
             {
69
                 onPress: openSettings,
63
                 onPress: openSettings,
70
-                text: 'Settings'
64
+                text: i18next.t('settings.title')
71
             }
65
             }
72
         ],
66
         ],
73
         { cancelable: false });
67
         { cancelable: false });

Loading…
Cancel
Save