summaryrefslogtreecommitdiff
path: root/platform/ios/src/NSOrthography+MGLAdditions.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/src/NSOrthography+MGLAdditions.m')
-rw-r--r--platform/ios/src/NSOrthography+MGLAdditions.m37
1 files changed, 0 insertions, 37 deletions
diff --git a/platform/ios/src/NSOrthography+MGLAdditions.m b/platform/ios/src/NSOrthography+MGLAdditions.m
deleted file mode 100644
index f48a2ffcbe..0000000000
--- a/platform/ios/src/NSOrthography+MGLAdditions.m
+++ /dev/null
@@ -1,37 +0,0 @@
-#import "NSOrthography+MGLAdditions.h"
-
-@implementation NSOrthography (MGLAdditions)
-
-+ (NSString *)mgl_dominantScriptForMapboxStreetsLanguage:(NSString *)language {
- if (@available(iOS 11.0, *)) {
- NSLocale *locale = [NSLocale localeWithLocaleIdentifier:language];
- NSOrthography *orthography = [NSOrthography defaultOrthographyForLanguage:locale.localeIdentifier];
-
- return orthography.dominantScript;
- }
-
- // Manually map Mapbox Streets languages to ISO 15924 script codes.
- NSSet *latinLanguages = [NSSet setWithObjects:@"de", @"en", @"es", @"fr", @"pt", nil];
- NSSet *hansLanguages = [NSSet setWithObjects:@"zh", @"zh-Hans", nil];
-
- if ([latinLanguages containsObject:language]) {
- return @"Latn";
- } else if ([hansLanguages containsObject:language]) {
- return @"Hans";
- } else if ([language isEqualToString:@"zh-Hant"]) {
- return @"Hant";
- } else if ([language isEqualToString:@"ru"]) {
- return @"Cyrl";
- } else if ([language isEqualToString:@"ar"]) {
- return @"Arab";
- } else if ([language isEqualToString:@"ja"]) {
- return @"Jpan";
- } else if ([language isEqualToString:@"ko"]) {
- return @"Kore";
- } else {
- // Code for undetermined script
- return @"Zyyy";
- }
-}
-
-@end