From d6936df2f5b9aeeb8e6212b56419d0ed5f2129cd Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Wed, 4 Jan 2023 15:09:56 +0100 Subject: [PATCH] Update install langs + Sentry on install --- ComApp/src/App/Views/HomeScreen.js | 1 + ComApp/src/App/Views/InstallScreen.js | 13 ++++++++++--- ComApp/src/Resources/Locales/de.json | 14 +++++++------- ComApp/src/Resources/Locales/en.json | 14 +++++++------- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ComApp/src/App/Views/HomeScreen.js b/ComApp/src/App/Views/HomeScreen.js index c3e1279..af2fa8c 100644 --- a/ComApp/src/App/Views/HomeScreen.js +++ b/ComApp/src/App/Views/HomeScreen.js @@ -116,6 +116,7 @@ class HomeScreen extends React.Component { } openFolder(id) { + this.props.initDocuments(this.props.locale, this.props.directories.global); const folder = this.props.directories.treeview.filter(tmp => tmp.id === id); this.props.navigation.navigate('DirectoriesScreen', { folder: folder }); } diff --git a/ComApp/src/App/Views/InstallScreen.js b/ComApp/src/App/Views/InstallScreen.js index 953b46e..7b00977 100644 --- a/ComApp/src/App/Views/InstallScreen.js +++ b/ComApp/src/App/Views/InstallScreen.js @@ -2,6 +2,8 @@ import React from 'react'; import { ImageBackground, View, Image, Text, TextInput, Button, Alert } from 'react-native'; // Redux import { connect } from 'react-redux'; +// Sentry +import * as Sentry from "@sentry/react-native"; // SplashScreen import * as SplashScreen from 'expo-splash-screen'; // Helpers @@ -24,7 +26,8 @@ import * as FileSystem from 'expo-file-system'; function mapStateToProps(state) { return { - isSetup: state.app.isSetup + isSetup: state.app.isSetup, + locale: state.locale.locale, }; } @@ -46,6 +49,7 @@ class InstallScreen extends React.Component { } render() { + i18n.locale = this.props.locale; return ( @@ -133,11 +137,14 @@ class InstallScreen extends React.Component { } } }).catch(function (error) { - console.log(error) + Sentry.captureException(error); Alert.alert(i18n.t("alert.error"), i18n.t("error.error_has_occurred")); return false; }); - + if (!toDL) { + this.setState({ processing: false, txtStep: "" }); + return false; + } for await (const file of toDL) { await FileSystem.downloadAsync( file.source, diff --git a/ComApp/src/Resources/Locales/de.json b/ComApp/src/Resources/Locales/de.json index 96f3546..89c4498 100644 --- a/ComApp/src/Resources/Locales/de.json +++ b/ComApp/src/Resources/Locales/de.json @@ -1,13 +1,13 @@ { "install": { "installation": "Installation", - "install": "Installer", - "enter_url": "Veuillez entrer le lien de votre back-office", - "url_invalid": "Le lien saisi est invalide.", - "resource_dl_error": "Une erreur est survenue lors du téléchargement de la ressource suivante : ", - "install_complete": "Installation terminée !", - "get_app_setting": "Récupération de la configuration de l'application", - "get_content_setting": "Récupération de la configuration du contenu de l'application" + "install": "Installieren Sie", + "enter_url": "Bitte geben Sie den Link zu Ihrem Backoffice ein", + "url_invalid": "Der eingegebene Link ist ungültig.", + "resource_dl_error": "Beim Herunterladen der folgenden Lerneinheit ist ein Fehler aufgetreten: ", + "install_complete": "Installation abgeschlossen!", + "get_app_setting": "Wiederherstellen der Konfiguration der Anwendung", + "get_content_setting": "Abrufen der Konfiguration des Inhalts der Anwendung" }, "global": { "change_lang": "Sprache wechseln", diff --git a/ComApp/src/Resources/Locales/en.json b/ComApp/src/Resources/Locales/en.json index 1e2f7ec..757a6c9 100644 --- a/ComApp/src/Resources/Locales/en.json +++ b/ComApp/src/Resources/Locales/en.json @@ -1,13 +1,13 @@ { "install": { "installation": "Installation", - "install": "Installer", - "enter_url": "Veuillez entrer le lien de votre back-office", - "url_invalid": "Le lien saisi est invalide.", - "resource_dl_error": "Une erreur est survenue lors du téléchargement de la ressource suivante : ", - "install_complete": "Installation terminée !", - "get_app_setting": "Récupération de la configuration de l'application", - "get_content_setting": "Récupération de la configuration du contenu de l'application" + "install": "Install", + "enter_url": "Please enter your back office link", + "url_invalid": "The link you entered is invalid.", + "resource_dl_error": "An error occurred while downloading the following resource: ", + "install_complete": "Installation is complete!", + "get_app_setting": "Retrieving the application's configuration", + "get_content_setting": "Retrieving the configuration of the application content" }, "global": { "change_lang": "Change language",