translate mapbox page 50%

This commit is contained in:
2025-07-27 20:42:56 +02:00
parent dcc2ec25de
commit 9e50b6d6f6
3 changed files with 48 additions and 12 deletions

View File

@@ -108,4 +108,19 @@
"remembr_me": "Remember me",
"new_user": "New User? Create Account",
"sign_in": "Sign in",
"map_token": "Mapbox Access Token is not available",
"geo_disabled": "Location services are disabled.",
"permission_denied":"Location permissions are denied.",
"enable_permission": "Location permissions are permanently denied. Enable them in settings.",
"no_last_position": "No last known position available.",
"failed_location": "Failed to get user location",
"failed_fetch": "Failed to fetch the route",
"invalid_coordinates_symbol": "Invalid coordinates, cannot add symbol.",
"error_symbol": "Error when adding symbol.",
"position_not_init": "User position is not yet initialized. Try again.",
"invalid_coordinates": "Invalid coordinates.",
"walking": "Walking",
"cycling": "Cycling",
"driving": "Driving",
"get_direction": "Get Directions and Markers"
}

View File

@@ -107,5 +107,20 @@
"enter_existing_pseudo": "Entrez un pseudo existant",
"remembr_me": "Se souvenir de moi",
"new_user": "Nouvel utilisateur ? Créer un compte",
"sign_in": "Se connecter"
"sign_in": "Se connecter",
"map_token": "Token d'accès de Mapbox n'est pas disponible",
"geo_disabled": "Les services de localisation sont désactivés.",
"permission_denied":"Les permissions de localisation sont refusées.",
"enable_permission": "Les permissions de localisation sont toujours désactivés. Il faut les désactiver",
"no_last_position": "Aucune position n'est pas disponible.",
"failed_location": "Échec de récupération des données geographique",
"failed_fetch": "Échec de récupération des routes",
"invalid_coordinates_symbol": "Coordonnées invalides. On ne peut pas ajouter le symbole",
"error_symbol": "Erreur lors de l'ajout du symbole",
"position_not_init": "Coordonnées non initialisées. Essaye encore.",
"invalid_coordinates": "Coordonnées invalides",
"walking": "Marche",
"cycling": "Vélo",
"driving": "Voiture",
"get_direction": "Get Directions and Markers"
}

View File

@@ -161,14 +161,19 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
// Handle location services disabled
position = await Geolocator.getLastKnownPosition();
if (position == null) {
print('No last known position available.');
showAlertDialog(
context,
AppLocalizations.of(context)?.error ?? "Error",
"No last known position available..");
}
} catch (e) {
// Handle other errors
print('Failed to get location: $e');
position = await Geolocator.getLastKnownPosition();
if (position == null) {
print('No last known position available.');
showAlertDialog(
context,
AppLocalizations.of(context)?.error ?? "Error",
"No last known position available");
}
}
if (position != null) {
@@ -201,7 +206,7 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
}).toList();
});
} else {
showAlertDialog(context, "Erreur serveur",
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
"Failed to fetch the route: ${response.statusCode}");
}
}
@@ -209,8 +214,6 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
// Called when the map is created
void _onStyleLoaded() async {
// Log the map controller and coordinates
print("Mapbox controller initialized: $mapController");
print("lat - long : $latitude - $longitude");
// Check if the mapController is really initialized
if (mapController != null) {
@@ -230,20 +233,23 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
);
// Debugging symbol options
print("Adding symbol with options: $symbolOptions");
// Add symbol to map
mapController!.addSymbol(symbolOptions);
} else {
print("Error: Invalid coordinates, cannot add symbol.");
showAlertDialog(
context,
AppLocalizations.of(context)?.error ?? "Error",
"Error: Invalid coordinates, cannot add symbol.");
}
} catch (e) {
// Handle any exception that occurs when adding the symbol
print("Error when adding symbol: $e");
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
"Error when adding symbol.");
}
} else {
print(
"Error: MapboxMapController is null at the time of symbol addition");
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
"Error when adding symbol.");
}
}