-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update automatic Streets localization for v8/v11 data/styles #13481
Update automatic Streets localization for v8/v11 data/styles #13481
Conversation
20bd0e3 to
ebd0074
Compare
How to avoid relocalization?The suggestion in #12164 (comment) is:
... but I’m unsure where ( |
| - (void)testv11Localization { | ||
| { | ||
| NSExpression *original = [NSExpression expressionWithFormat:@"mgl_coalesce({%K, %K})", @"name_en", @"name"]; | ||
| NSExpression *expected = [NSExpression expressionWithFormat:@"mgl_coalesce:({name_en, name})"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the ideal result, but we current get mgl_coalesce:({mgl_coalesce:({name_en, name}), mgl_coalesce:({name_en, name})}) instead.
ebd0074 to
d58e72f
Compare
|
After conferring with @1ec5 , I reduced the scope of this PR to only making localization functional with the new data/styles — ready for review. 🙇 |
d58e72f to
f292cbe
Compare
| } | ||
| NSArray *identifiers = [url.host componentsSeparatedByString:@","]; | ||
| return [identifiers containsObject:@"mapbox.mapbox-streets-v7"] || [identifiers containsObject:@"mapbox.mapbox-streets-v6"]; | ||
| return [identifiers containsObject:@"mapbox.mapbox-streets-v8"] || [identifiers containsObject:@"mapbox.mapbox-streets-v7"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it’s worth, @friedbunny and I determined that it’s very unlikely for any v6-dependent styles to have been used with runtime styling in the first place.
| // https://www.mapbox.com/vector-tiles/mapbox-streets-v7/#overview | ||
| NSArray *supportedLanguages = @[ @"ar", @"en", @"es", @"fr", @"de", @"pt", @"ru", @"zh", @"zh-Hans" ]; | ||
| // https://www.mapbox.com/vector-tiles/mapbox-streets-v8/#name-text--name_lang-code-text | ||
| NSArray *supportedLanguages = @[ @"ar", @"de", @"en", @"es", @"fr", @"ja", @"ko", @"pt", @"ru", @"zh", @"zh-Hans", @"zh-Hant" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it’s OK that we have only one list of supported languages. It looks like the only language code that’s in v8 but not v7 is zh-Hant, but #12387 already added a special case to ensure that zh-Hant falls back to zh-Hans, which v7 does (mostly) support.
:squints: Co-Authored-By: friedbunny <[email protected]>
Addresses the simple automatic localization case from #11867.
This enables automatic localization of Mapbox Streets source v8 and the forthcoming Streets v11 style, but does not yet implement a solution to the relocalization issues explained in #12164 (comment) — that’ll be handled as tail work, tracked by #11867.
/cc @1ec5