-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preferred locale provider returns correct language code
`TXPreferredLocaleProvider` used to rely on the `NSLocale.autoupdatingCurrent` property to fetch the current locale of the device, but the property was not returning the correct language code. The updated code looks into the `preferredLanguages` property list of the `Locale` class instead, and if that list is not empty (which is usually the case), picks the first language and sets it as the current locale, which reflects the user choice. On top of that, a new unit test method is added that adds the greek language in the list of the preferred languages and asserts whether that language code is returned by the `TXLocaleState.currentLocale` property. Last, some existing unit tests that were not running are now enabled.
- Loading branch information
1 parent
a326fbf
commit 39b5f70
Showing
4 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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