diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-04-10 21:20:46 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-04-16 14:46:50 -0700 |
commit | b9f045942fe76371588acf191bc91e88bb2cbf15 (patch) | |
tree | 73e440cf0a75b85466f3a45cdd66b6fd5e46c674 | |
parent | e8e188c21cc70529ef7a9f9b39bc8ee9dedabd2e (diff) | |
download | qtlocation-mapboxgl-b9f045942fe76371588acf191bc91e88bb2cbf15.tar.gz |
[ios, macos] Fixed local name labels
-rw-r--r-- | platform/darwin/src/NSExpression+MGLAdditions.mm | 5 | ||||
-rw-r--r-- | platform/macos/app/MapDocument.m | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm index 4c6bff57f8..c21680037c 100644 --- a/platform/darwin/src/NSExpression+MGLAdditions.mm +++ b/platform/darwin/src/NSExpression+MGLAdditions.mm @@ -1125,7 +1125,10 @@ NS_DICTIONARY_OF(NSNumber *, NSExpression *) *MGLLocalizedStopDictionary(NS_DICT }; - (NSExpression *)mgl_expressionLocalizedIntoLocale:(nullable NSLocale *)locale replacingTokens:(BOOL)replacesTokens { - NSString *localizedKeyPath = locale ? [NSString stringWithFormat:@"name_%@", locale.localeIdentifier] : @"name"; + NSString *localizedKeyPath = @"name"; + if (locale && ![locale.localeIdentifier isEqualToString:@"mul"]) { + localizedKeyPath = [NSString stringWithFormat:@"name_%@", locale.localeIdentifier]; + } switch (self.expressionType) { case NSConstantValueExpressionType: { if (replacesTokens) { diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 7a3ab85acc..9b18dbd761 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -421,7 +421,7 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio } - (void)updateLabels { - [self.mapView.style localizeLabelsIntoLocale:_isLocalizingLabels ? [NSLocale localeWithLocaleIdentifier:@"mul"] : nil]; + [self.mapView.style localizeLabelsIntoLocale:_isLocalizingLabels ? nil : [NSLocale localeWithLocaleIdentifier:@"mul"]]; } - (void)applyPendingState { |