If I request the current locales identifier on iOS, it returns just the identifier string:
let identifier = NSLocale.current.identifier // en_GB
However, on macOS 10.12.2 it also returns the currency:
let identifier = NSLocale.current.identifier // en_GB@currency=GBP
Is this a bug or expected behaviour?
I think the best option for me here is to generate the code myself. To help with this I have created an extension on
Locale
:While this is accurate enough for my purposes, you should probably ensure it returns expected values for your project.