Archive for May 7, 2019

Tuesday, May 7, 2019

Tying the Locale to the Localization

Apple:

The locale is formed from the settings for the current user’s chosen system locale overlaid with any custom settings the user has specified.

However, it doesn’t work that way anymore on macOS 10.14. (And I think this was documented or explained at WWDC, but I can’t seem to find it in the release notes or video.)

Peter N Lewis:

So basically there is no way an OSX application in 10.14 can display the time according to the user’s settings unless it is localised in the user’s language? That is severely messed up.

[…]

NSLocale currentLocale returns english (if you are localized in english) regardless of the user language. And there does not appear to be any way to read the 24 hour setting, or even just change a date formatter to a specific 24 hour setting.

I think the reasoning was to make the display within the app consistent, which kind of makes sense, though I think many users would rather see consistent dates (that follow their preferences) across all apps. But then there are cases like Lewis’s where the formatted text is not even necessarily displayed in the app; it’s just produced by it:

Keyboard Maestro generates dates based on the “current” locale. Pre-10.14, that was your locale as you define. In 10.14, they change it so that it is the locale of the localization of the app. So since Keyboard Maestro is English-only, you get an English locale regardless.

Previously: +[NSLocale preferredLanguages] vs -[NSBundle preferredLocalizations].

Update (2019-06-20): Karan:

For apps whose content is derived primarily from Locale, Formatter, etc., those apps can be opted into CFBundleAllowMixedLocalizations (see here), which will return the behaviour of currentLocale to ignoring the loaded bundle.

Peter N Lewis:

Unfortunately there is no way for a user to “opt back out” for an application in Mojave that worked properly in every previous version. No “default write” or the like, only a plist change will allow it. Also no way to control it for date formatting etc without mixing the UI.

Non-Standard Emoji Colors

Howard Oakley:

I wanted to include the international Quarantine flag, known as Flag Lima, with black and yellow chequers. That is the flag still flown from ships in harbour when they remain under quarantine, before being allowed free entry into a port. It would have been very appropriate to my two articles.

[…]

So just what is the colour of Unicode code point U+1F397? How could WordPress possibly have found me a blue ribbon when everywhere else it’s yellow?

[…]

I’ve long had my doubts about the ability of emoji, particularly those included in Unicode, to support even the vaguest emotional communication. This only goes to show how flawed they are. So I’m sorry if you were somewhat mystified by the appearance of unrelated emoji in the titles of those two articles. It wasn’t me, it was a standard which in this case doesn’t appear to define anything meaningful.

Previously: Quarantine: Apps and Documents.