In Objective C, one can create a CFLocale as follows (taken from this post in 2012):
CFLocaleRef myLocale = CFLocaleCopyCurrent()
for the current locale; or:CFLocaleRef myLocale = CFLocaleCreate(kCFAllocatorDefault, CFSTR("ja"))
, for a target locale. The locale name comes from the rightmost column of the ISO 639-1/639-2 table, which Apple specifies as their standard for language codes here.*
*Note: very old code examples refer to long language codes like 'Japanese', as may be expected by versions of Mac OS X older than 10.4.
How does one create a CFLocale in Swift 3, as the API appears to have changed in several ways?