summaryrefslogtreecommitdiff
path: root/platform/macos/src
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-03-18 14:59:11 -0700
committerGitHub <noreply@github.com>2017-03-18 14:59:11 -0700
commitf846205eb68e9508a0d80259008cf9adb8069a1b (patch)
treeeeea54428883e141044a9b24f031f4cc5b142525 /platform/macos/src
parentb3fe46728da2ed9ae31f2eb0ff2e0b2538bced72 (diff)
downloadqtlocation-mapboxgl-f846205eb68e9508a0d80259008cf9adb8069a1b.tar.gz
[ios, macos] Fix map load error descriptions (#8466)
* [ios, macos] Corrected map load error descriptions Ensured the uniqueness of localizable string IDs. Ran make genstrings to add the -[MGLMapViewDelegate mapViewDidFailToLoad:withError:] error description strings to the base localization. * [ios, macos] Moved failure error changelog entry to new release
Diffstat (limited to 'platform/macos/src')
-rw-r--r--platform/macos/src/MGLMapView.mm13
1 files changed, 8 insertions, 5 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 5a5073e22d..5d0f5b7923 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -2802,18 +2802,21 @@ public:
std::rethrow_exception(exception);
} catch (const mbgl::util::StyleParseException&) {
code = MGLErrorCodeParseStyleFailed;
- description = NSLocalizedStringWithDefaultValue(@"PARSE_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because the style is corrupted.", @"");
+ description = NSLocalizedStringWithDefaultValue(@"PARSE_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because the style is corrupted.", @"User-friendly error description");
} catch (const mbgl::util::StyleLoadException&) {
code = MGLErrorCodeLoadStyleFailed;
- description = NSLocalizedStringWithDefaultValue(@"PARSE_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because the style can't be loaded.", @"");
+ description = NSLocalizedStringWithDefaultValue(@"LOAD_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because the style can't be loaded.", @"User-friendly error description");
} catch (const mbgl::util::NotFoundException&) {
code = MGLErrorCodeNotFound;
- description = NSLocalizedStringWithDefaultValue(@"LOAD_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because the style can’t be found or is incompatible.", @"");
+ description = NSLocalizedStringWithDefaultValue(@"STYLE_NOT_FOUND_DESC", nil, nil, @"The map failed to load because the style can’t be found or is incompatible.", @"User-friendly error description");
} catch (...) {
code = MGLErrorCodeUnknown;
- description = NSLocalizedStringWithDefaultValue(@"LOAD_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because an unknown error occurred.", @"");
+ description = NSLocalizedStringWithDefaultValue(@"LOAD_MAP_FAILED_DESC", nil, nil, @"The map failed to load because an unknown error occurred.", @"User-friendly error description");
}
- NSDictionary *userInfo = @{NSLocalizedDescriptionKey:description, NSLocalizedFailureReasonErrorKey:@(mbgl::util::toString(exception).c_str())};
+ NSDictionary *userInfo = @{
+ NSLocalizedDescriptionKey: description,
+ NSLocalizedFailureReasonErrorKey: @(mbgl::util::toString(exception).c_str()),
+ };
NSError *error = [NSError errorWithDomain:MGLErrorDomain code:code userInfo:userInfo];
[nativeView mapViewDidFailLoadingMapWithError:error];
}