GLMapLocaleSettings

Objective-C


@interface GLMapLocaleSettings : NSObject

Swift

class GLMapLocaleSettings : NSObject

GLMapLocaleSettings is used to set the language order for all GLMapView objects. For each label on the map, the framework checks the translated names in the order set by -initWithLocalesOrder:, if no translated label is available - the native name is used. Following map languages are included in the vector map data:

native - native language for the country or region
ar - Arabic
be - Belarusian
cs - Czech
da - Danish
de - German
en - English
es - Spanish
fr - French
it - Italian
ja - Japanese
ko - Korean
nl - Dutch
pl - Polish
pt - Portuguese
ru - Russian
sv - Swedish
uk - Ukrainian
zh - Chinese

Check Multilingual names in OpenStreetMap for more information.

Static Methods

  • Declaration

    Objective-C

    + (GLMapLocaleSettings *_Nonnull)systemSettings;

    Swift

    class func system() -> GLMapLocaleSettings

    Return Value

    Settings object gets values from +[NSLocale preferredLanguages] to set the order of locales.

  • Sets of supported map languages.

    Declaration

    Objective-C

    + (NSSet<NSString *> *_Nonnull)supportedLocales;

    Swift

    class func supportedLocales() -> Set<String>

    Return Value

    Returns language codes supported by the framework.

  • Declaration

    Objective-C

    + (BOOL)isLocaleSupported:(NSString *_Nonnull)locale;

    Swift

    class func isLocaleSupported(_ locale: String) -> Bool

    Return Value

    Returns YES if mapLanguage is among supported languages.

Methods

  • Creates an instance of GLMapLocaleSettings with a given order of locales.

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithLocalesOrder:
                                 (NSArray<NSString *> *_Nullable)localesOrder
                                       unitSystem:(GLUnitSystem)unitSystem;

    Swift

    init(localesOrder: [String]?, unitSystem: GLUnitSystem)

    Parameters

    localesOrder

    An ordered array of language codes.

    unitSystem

    The active unit system.

    Return Value

    A new locale settings object.

  • Locales order set during object initialization.

    Declaration

    Objective-C

    @property (readonly) NSArray<NSString *> *_Nullable localesOrder;

    Swift

    var localesOrder: [String]? { get }
  • Get localized string for key.

    Declaration

    Objective-C

    - (NSString *_Nonnull)localizedString:(NSString *_Nonnull)key;

    Swift

    func localizedString(_ key: String) -> String

    Return Value

    localized string.