[ios] Announce POI categories where available

This commit is contained in:
Minh Nguyễn
2018-12-08 01:43:35 -08:00
committed by Minh Nguyễn
parent 3dffb1fd53
commit 04c70f55a5

View File

@@ -78,7 +78,11 @@
NSMutableArray *facts = [NSMutableArray array];
// Announce the kind of place or POI.
if (attributes[@"type"]) {
NSString *languageCode = [MGLVectorTileSource preferredMapboxStreetsLanguage];
NSString *categoryAttribute = [NSString stringWithFormat:@"category_%@", languageCode];
if (attributes[categoryAttribute]) {
[facts addObject:attributes[categoryAttribute]];
} else if (attributes[@"type"]) {
// FIXME: Unfortunately, these types aren’t a closed set that can be
// localized, since they’re based on OpenStreetMap tags.
NSString *type = [attributes[@"type"] stringByReplacingOccurrencesOfString:@"_"
@@ -88,7 +92,6 @@
// Announce the kind of airport, rail station, or mountain based on its
// Maki image name.
else if (attributes[@"maki"]) {
// TODO: Localize Maki image names.
[facts addObject:attributes[@"maki"]];
}