2

How do iOS apps evaluate to a specific Locale?

Regarding Apple Docs, it follows standardized way (CLDR) with apple customized fallback strategies.

In Swift, I'm trying to figure out how Locale.current.identifier or Objective-C equivalent specifically output:

  • en
  • en_150
  • es
  • ...

(Without having a region designator)

How do I configure the simulator or device to achieve this?

What else influences Locale.current?

  • preferred language(s) (also the order)
  • selected region
  • supported languages from your app
  • (some other settings like calendar, phonebook collation) these are suffixed with an @

Interesting sources:

https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html

https://opensource.apple.com/source/ICU/ICU-57131.0.1/icuSources/common/unicode/ualoc.h.auto.html

https://forums.developer.apple.com/thread/71383

boehlefeld
  • 201
  • 2
  • 7
  • You are not going to get just `en`. You will get, for example, `en_US` or whatever country based on the selected region. – rmaddy May 07 '19 at 16:24
  • Thanks for your comment. But I do have backend logs from devices around the globe without having a region. That's why I'm asking. – boehlefeld May 09 '19 at 05:54

0 Answers0