Internationalisation and Localisation in iOS8+

Locale is made up of "Language" + [optional script] + "Region" + [optional keywords]. Locale settings are based on user preferences and not a reliable source for other operations, e.g; Getting user's "Physical Location"/"Country of residence" which should be obtained by CoreLocation API.

Locale settings are auto imposed by iOS itself we don't need to do additional coding for the same until or unless we are't going off-track. For some special cases like if we want to get localized data from server you can access Locale setting to do so. We can also use the same logic which are being used by NSBundle by +[NSBundle preferredLocalizationsFromArray:(NSArray *)localizationsArray]

NSLinguisticTagger can be used for Document linguistice content.

We can get Locale change notification with NSCurrentLocaleDidChangeNotification and impliment it on the go. There are two kinda prefrences for iOS users to chose localisation based on which App and web sites use the language they support, i.e;
  1. Preferred languages - it determines;
    • NSBundle
    • NSLocalizedString
    • HTTP header "Accept-Language" in WebKit
  2. Local/Regional preferences - it determines;
    • NSLocale properties
    • Formatter behaviour
    • NSCalendar

PFB - list of major changes in iOS8+ localisation

  1. New localisation
    • Hindi
    • Indian English
    • Canadian French
    • Hong Kong Chinese
  2. New keyboards
    • Bengali
    • Marathi
    • Urdu
    • Indian English
    • Filipino
    • Slovenian
  3. New fonts for various languages
  4. Language and region settings
    • Specify primary language
    • Specify preferred language order
    • Localisation into other non-native languages
    • Specify region format language independently
  5. Lunar calendar support with two new Islamic calendars
  6. String encoding detection/conversion for unknown source file with lossy and non-lossy both
  7. New formatters with formatting context support, i.e;
    • NSDateComponentsFormatter - Display duration of time in various languages
    • NSDateIntervalFormatter - Display time-intervals in various languages
    • NSEnergyFormatter - Display energy units (e.g; Calories) in various languages
    • NSLengthFormatter - Display length (e.g; Miles, KM..) in various languages
    • NSMassFormatter - Display mass (e.g; Pound, Kg..) in various languages
Good to knows; Because of multiple keyboard support by iOS8+ we need to manage views based on the keyboard size change.

1 comment:

  1. Hello, Gaurav S Tomar!
    If you are an app developer and are interested in localizing your apps for the global market, you may find useful the online localization platform https://poeditor.com/
    It is helpful for managing the string translation process, because you can bring translators to collaboratively work there in real time, while watched over by admins, and it has a lot of features that automate the process a lot, like API and Translation Memory.
    I hope you will find it useful. Good luck with all your projects!

    ReplyDelete