diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/values-fr/strings.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/values-fr/strings.xml index e31c6935ed9..67b5b21072f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/values-fr/strings.xml +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/values-fr/strings.xml @@ -14,4 +14,4 @@ Le cadre OfflineRegionDefinition pour définir la région de navigation ne tient pas dans les limites du monde : %s Améliorer cette carte Paramètres de télémétrie - + \ No newline at end of file diff --git a/platform/darwin/resources/Base.lproj/Foundation.strings b/platform/darwin/resources/Base.lproj/Foundation.strings index 360e3c85627..f092bdab30f 100644 --- a/platform/darwin/resources/Base.lproj/Foundation.strings +++ b/platform/darwin/resources/Base.lproj/Foundation.strings @@ -298,9 +298,9 @@ /* OpenStreetMap short name attribution */ "OSM_SHORT_NAME" = "OSM"; -/* User-friendly error description */ -"REMOVE_SRC_FAIL_IN_USE_FMT" = "Source '%@' is in use, cannot remove."; +/* User-friendly error description; first placeholder is the source’s identifier */ +"REMOVE_SRC_FAIL_IN_USE_FMT" = "The source “%@” can’t be removed while it is in use."; /* User-friendly error description */ -"REMOVE_SRC_FAIL_MISMATCH_FMT" = "Identifier '%1$@' does not match source identifier '%2$s'"; +"REMOVE_SRC_FAIL_MISMATCH_FMT" = "The source can’t be removed because its identifier, “%@”, belongs to a different source in this style."; diff --git a/platform/darwin/resources/fr.lproj/Foundation.strings b/platform/darwin/resources/fr.lproj/Foundation.strings index 2e819f9192c..1926da6bb42 100644 --- a/platform/darwin/resources/fr.lproj/Foundation.strings +++ b/platform/darwin/resources/fr.lproj/Foundation.strings @@ -1,5 +1,5 @@ /* User-friendly error description */ -"ADD_FILE_CONTENTS_FAILED_DESC" = "Impossible d'ajouter le contenu hors ligne à partir du fichier %@."; +"ADD_FILE_CONTENTS_FAILED_DESC" = "Impossible d’ajouter le contenu hors ligne à partir du fichier %@."; /* Clock position format, long: {hours} o’clock */ "CLOCK_FMT_LONG" = "%@ h"; @@ -299,8 +299,5 @@ "OSM_SHORT_NAME" = "OSM"; /* User-friendly error description */ -"REMOVE_SRC_FAIL_IN_USE_FMT" = "La source '%@' est en cours d'utilisation, impossible de la supprimer."; - -/* User-friendly error description */ -"REMOVE_SRC_FAIL_MISMATCH_FMT" = "L'identifiant '%1$@' ne correspond pas à l'identifiant de la source '%2$s'"; +"REMOVE_SRC_FAIL_IN_USE_FMT" = "La source « %@ » est en cours d’utilisation, impossible de la supprimer."; diff --git a/platform/darwin/src/MGLSource.mm b/platform/darwin/src/MGLSource.mm index 62d3cfa808b..fd546274714 100644 --- a/platform/darwin/src/MGLSource.mm +++ b/platform/darwin/src/MGLSource.mm @@ -70,20 +70,19 @@ - (BOOL)removeFromMapView:(MGLMapView *)mapView error:(NSError * __nullable * __ _pendingSource = std::move(removedSource); _mapView = nil; } else if (outError) { - NSString *format = NSLocalizedStringWithDefaultValue(@"REMOVE_SRC_FAIL_IN_USE_FMT", @"Foundation", nil, @"Source '%@' is in use, cannot remove.", @"User-friendly error description"); - NSString *localizedDescription = [NSString stringWithFormat:format, self.identifier]; + NSString *localizedDescription = [NSString stringWithFormat: + NSLocalizedStringWithDefaultValue(@"REMOVE_SRC_FAIL_IN_USE_FMT", @"Foundation", nil, @"The source “%@” can’t be removed while it is in use.", @"User-friendly error description; first placeholder is the source’s identifier"), + self.identifier]; *outError = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeSourceIsInUseCannotRemove userInfo:@{ NSLocalizedDescriptionKey : localizedDescription }]; } - } - else if (outError) { - // Consider raising an exception here - NSString *format = NSLocalizedStringWithDefaultValue(@"REMOVE_SRC_FAIL_MISMATCH_FMT", @"Foundation", nil, @"Identifier '%@' does not match source identifier '%s'", @"User-friendly error description"); - NSString *localizedDescription = [NSString stringWithFormat:format, - self.identifier, - self.rawSource ? self.rawSource->getID().c_str() : "(null)"]; + } else if (outError) { + // TODO: Consider raising an exception here + NSString *localizedDescription = [NSString stringWithFormat: + NSLocalizedStringWithDefaultValue(@"REMOVE_SRC_FAIL_MISMATCH_FMT", @"Foundation", nil, @"The source can’t be removed because its identifier, “%@”, belongs to a different source in this style.", @"User-friendly error description"), + self.identifier]; *outError = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeSourceIdentifierMismatch diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 7303ae4dec2..155d34a3a9e 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -10,7 +10,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### Styles and rendering * Fixed an issue where the `{prefix}` token in tile URL templates was evaluated incorrectly when requesting a source’s tiles. ([#13429](https://github.com/mapbox/mapbox-gl-native/pull/13429)) -* Added `-[MGLStyle removeSource:error:]` that returns a `BOOL` indicating success (and an optional `NSError` in case of failure). ([#13399](https://github.com/mapbox/mapbox-gl-native/pull/13399)) +* Added an `-[MGLStyle removeSource:error:]` method that returns a descriptive error if the style fails to remove the source, whereas `-[MGLStyle removeSource:]` fails silently. ([#13399](https://github.com/mapbox/mapbox-gl-native/pull/13399)) * Added support for setting `MGLCollisionBehaviorPre4_0` in `NSUserDefaults`. ([#13426](https://github.com/mapbox/mapbox-gl-native/pull/13426)) * Modified the behavior of the map view so that programmatic camera transitions can no longer be interrupted by user interaction when `MGLMapView.zoomEnabled`, `MGLMapView.rotateEnabled`, `MGLMapView.scrollEnabled`, and `MGLMapView.pitchEnabled` are set to false. ([#13362](https://github.com/mapbox/mapbox-gl-native/pull/13362)) diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 2fc39350781..16926092575 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -4,7 +4,7 @@ * `MGLMapSnapshotter` now follows "MGLIdeographicFontFamilyName" app setting to reduce font data usage while snapshotting CJK maps [#13427](https://github.com/mapbox/mapbox-gl-native/pull/13427) * Fixed an issue where the `{prefix}` token in tile URL templates was evaluated incorrectly when requesting a source’s tiles. ([#13429](https://github.com/mapbox/mapbox-gl-native/pull/13429)) -* Added `-[MGLStyle removeSource:error:]` that returns a `BOOL` indicating success (and an optional `NSError` in case of failure). ([#13399](https://github.com/mapbox/mapbox-gl-native/pull/13399)) +* Added an `-[MGLStyle removeSource:error:]` method that returns a descriptive error if the style fails to remove the source, whereas `-[MGLStyle removeSource:]` fails silently. ([#13399](https://github.com/mapbox/mapbox-gl-native/pull/13399)) * Added support for setting `MGLCollisionBehaviorPre4_0` in `NSUserDefaults`. ([#13426](https://github.com/mapbox/mapbox-gl-native/pull/13426)) * Added the `MGLFillExtrusionStyleLayer.fillExtrusionHasVerticalGradient` property. ([#13463](https://github.com/mapbox/mapbox-gl-native/pull/13463))