You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
So long as you're here, this should be NSMutableArray<NSString*>* data = [[NSMutableArray new] autorelease];. I have another PR that fixes it, but might as well get it now.
In this case, we'll end up setting the locales to ["en_US", "en"] and skip "ru_US" altogether.
It seems like we should always add [NSLocale currentLocale] to the head of the list, then walk [NSLocale preferredLanguages], adding them to the list if they're not already covered by the current locale.
The reason will be displayed to describe this comment to others. Learn more.
The first item isn't always necessarily the same as currentLocale. I believe currentLocale makes a best determination as to what language the app should use based on system preferred languages and languages declared in the app bundle.
Also iOS allows setting preferred languages which the system itself does not support, like Filipino. So the phone system language will be something else like English, but if your app declares it supports Filipino then currentLocale does indeed return Filipino.
Since our app does support Filipino, with phone language English and Filipino as top preferred language we get:
currentLocale fil_US
preferredLanguages ("fil-US", "en-US", "pl-US", "ru-US", "es-US")
But if I then add Armenian (hy) as the top preferred language, which neither the system UI nor our app support, then we get:
currentLocale fil_US
preferredLanguages ("hy-US", "fil-US", "en-US", "pl-US", "ru-US", "es-US")
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So long as you're here, this should be
NSMutableArray<NSString*>* data = [[NSMutableArray new] autorelease];. I have another PR that fixes it, but might as well get it now.