lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
245 stars 17 forks source link

50666761: Locale.current ignores localization native development region for Russian locale #21253

Open openradar-mirror opened 5 years ago

openradar-mirror commented 5 years ago

Description

Our app supports Russian, Ukrainian and Turkish localizations. When only English is selected in iOS Settings, Locale.current returns uk_US, but Localization native development region is set to "ru". NSLocalizedString however provides strings in correct locale (russian). DateFormatters also provide strings in ukrainian (supposably as they are using Locale.current under the hood).

As result, app is presented to user in two languages at the same time: Ukrainian and Russian.

Steps to Reproduce:

  1. Create new project.
  2. Remove English localization
  3. Add Russian, Ukrainian, Turkish localizations
  4. Open project file in text editor
  5. Replace "developmentRegion = en" to "developmentRegion = ru". Optionally set CFBundleDevelopmentRegion to "ru" in Info.plist.
  6. Erase content and settings or select only English language in iOS Settings.
  7. Check output of NSLocalizedString and Locale.current.

or

Execute step 6 and open attached sample app.

Expected Results: Locale.current returns ru_US. DateFormatters and NSLocalizedString return strings in Russian.

Actual Results: Locale.current returns uk_US. DateFormatters return strings in Ukrainian. NSLocalizedString returns strings from ru.lproj.

Configuration: Tested on iOS 12, simulators and devices.

If there is any workaround, please tell us how it can be applied.

- Product Version: Created: 2019-05-10T17:13:36.484049 Originated: 2019-05-10T00:00:00 Open Radar Link: http://www.openradar.me/50666761