GLMapLocaleSettings

Objective-C


@interface GLMapLocaleSettings : NSObject

Swift

class GLMapLocaleSettings : NSObject

GLMapLocaleSettings is used to set language order to all GLMapView objects.

For each label on map framework checks translated names in order set by -initWithLocalesOrder:, if no translated label is available - native name is used.

Following map languages is included in vector map data

  • native - native language in for 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 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 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 instance of GLMapLocaleSettings with 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

    Ordered array of language codes

    unitSystem

    Active unit system

    Return Value

    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