diff options
author | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2019-04-15 13:54:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-15 13:54:53 -0700 |
commit | a8526b4c91a2eaad0f915a59f420c513d40aa1ac (patch) | |
tree | b93cdbb4f777cebdb16fc058b8dc4e88b3a4a5fd /platform/darwin/src/NSExpression+MGLAdditions.mm | |
parent | 0ac95bd994b820f73811863bb744bf8f07459f08 (diff) | |
download | qtlocation-mapboxgl-a8526b4c91a2eaad0f915a59f420c513d40aa1ac.tar.gz |
[ios, macos] Fix MGLSymbolStyleLayer.text localization issue. (#14405)
Fixed an MGLSymbolStyleLayer.text localization bug caused by the introduction of MGLAttributedExpression object. The localization parsing was ignoring the latter.
* [ios, macos] Fix a localization issue.
* [ios, macos] Add formating expressions localization test.
* [ios, macos] Update MGLSymbolStyleLayer.text documentation.
Diffstat (limited to 'platform/darwin/src/NSExpression+MGLAdditions.mm')
-rw-r--r-- | platform/darwin/src/NSExpression+MGLAdditions.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm index 4b1fdb818e..9dad00e56e 100644 --- a/platform/darwin/src/NSExpression+MGLAdditions.mm +++ b/platform/darwin/src/NSExpression+MGLAdditions.mm @@ -1471,6 +1471,12 @@ NSDictionary<NSNumber *, NSExpression *> *MGLLocalizedStopDictionary(NSDictionar if (localizedValues != self.constantValue) { return [NSExpression expressionForConstantValue:localizedValues]; } + } else if ([self.constantValue isKindOfClass:[MGLAttributedExpression class]]) { + MGLAttributedExpression *attributedExpression = (MGLAttributedExpression *)self.constantValue; + NSExpression *localizedExpression = [attributedExpression.expression mgl_expressionLocalizedIntoLocale:locale]; + MGLAttributedExpression *localizedAttributedExpression = [MGLAttributedExpression attributedExpression:localizedExpression attributes:attributedExpression.attributes]; + + return [NSExpression expressionForConstantValue:localizedAttributedExpression]; } return self; } |