twostraws / ControlRoom

A macOS app to control the Xcode Simulator.
MIT License
5.75k stars 306 forks source link

Unable to set UK English for Language #125

Open squarefrog opened 3 years ago

squarefrog commented 3 years ago

If I use the Simulator's Settings app to set my language to English (UK), then the .GlobalPreferences.plist contains the following:

<key>AppleLanguages</key>
<array>
    <string>en-GB</string>
</array>

The NSLocale.isoLanguageCodes array, doesn't include this value (shown below), therefore it isn't possible to select UK English in ControlRoom.

let english = NSLocale.isoLanguageCodes.filter { $0.hasPrefix("en") }
print(english) // ["en", "enm"]

I thought about just injecting this value into the .isoLanguageCodes array, however this presents a further problem:

let enGB = NSLocale.current.localizedString(forLanguageCode: "en-GB")
print(enGB ?? "Unknown") // English, not English (UK)

I wonder if this does imply there is a better option for generating the drop down list of languages?

As a side note, I was surprised by the inclusion of Klingon (tlh)...

Mcrich23 commented 2 years ago

In order to do this, just change the locale