Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
<string name="mapbox_offline_error_region_definition_invalid">Le cadre OfflineRegionDefinition pour définir la région de navigation ne tient pas dans les limites du monde : %s</string>
<string name="mapbox_telemetryImproveMap">Améliorer cette carte</string>
<string name="mapbox_telemetrySettings">Paramètres de télémétrie</string>
</resources>
</resources>
6 changes: 3 additions & 3 deletions platform/darwin/resources/Base.lproj/Foundation.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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.";

7 changes: 2 additions & 5 deletions platform/darwin/resources/fr.lproj/Foundation.strings
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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'";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove this translation, which was added in #13360, because the new source string takes only a single string placeholder, not two string placeholders.

"REMOVE_SRC_FAIL_IN_USE_FMT" = "La source « %@ » est en cours d’utilisation, impossible de la supprimer.";

17 changes: 8 additions & 9 deletions platform/darwin/src/MGLSource.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion platform/macos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down