Bug 11408 - System.Globalization.CultureInfo.CurrentCulture is not updated when region is changed
Summary: System.Globalization.CultureInfo.CurrentCulture is not updated when region is...
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.2.x
Hardware: Macintosh Mac OS
: --- enhancement
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
: 15367 ()
Depends on:
Blocks:
 
Reported: 2013-03-26 02:57 UTC by Low
Modified: 2017-08-29 18:20 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Low 2013-03-26 02:57:53 UTC
System.Globalization.CultureInfo.CurrentCulture do not seem to
be updated if region is changed.

Steps to reproduce:
1. Open app
2. Go to settings -> General -> International -> Region Format. Change to Danish (Denmark)
3. Go back to app.
4. CurrentCulture is still not updated.

Note: iOS API (NSLocale, NSDateFormmater, NSNumberFormmater) is updated with new info.
This cause problem because other UI component (keyboard, datepicker...) is updated with new region format.
Comment 1 Sebastien Pouliot 2013-04-02 14:44:27 UTC
This is not done automatically. The region information that .NET and iOS provides are very similar but not identical. That makes it hard to switch automatically without risking breaking existing code.

However, if the differences don't matter to your application, you can easily opt-in by listening for the region change notification and change the CurrentCulture (or UICurrentCulture) to match (but it's not a 1-to-1 mapping).

The documentation for ObserveCurrentLocaleDidChange [1] has sample code that gets notified of a region change.

[1] http://api.xamarin.com/index.aspx?link=M%3AMonoTouch.Foundation.NSLocale.Notifications.ObserveCurrentLocaleDidChange(System.EventHandler%7BMonoTouch.Foundation.NSNotificationEventArgs%7D)
Comment 2 felix.Speedmaster 2013-10-11 08:37:29 UTC
This problem is now 6 month old, is there any time when this is getting done?
Comment 3 Frank A. Krueger 2013-10-11 16:33:18 UTC
*** Bug 15367 has been marked as a duplicate of this bug. ***
Comment 4 Mohib Sheth 2016-12-28 09:59:49 UTC
We are facing this too and would like to know what's the decision? Will this be fixed in Xamarin or will we have to handle it manually?
Comment 5 Mohib Sheth 2016-12-28 10:01:59 UTC
Sorry for double post.

Please note that the problem here is not that CurrentCulture is not updated when only Region is changed while the app is running. Problem is that CurrentCulture is not updated at all, even if the app is killed and restarted. CurrentCulture seems to be solely dependant on Language setting of device and seems to ignore the Region setting.
Comment 6 Mohib Sheth 2017-01-24 05:47:37 UTC
Hello, can somebody let us know? Is this on the roadmap?
Comment 7 Prashant [MSFT] 2017-07-26 08:37:46 UTC
Thanks so much for taking the time to submit this report! I’m unable to reproduce this issue using the latest Xamarin.iOS 10.12.0.14. Running iOS simulator v10.3

Please attach the following to help us reproduce this issue: 

-Detailed reproduction steps 
-Version information (Visual Studio → About Visual Studio menu) 
-Logs (Help → Open Log Directory, zip logs for the last 10 days) 
-Optional: project to reproduce your issue
Comment 8 Vincent Dondain [MSFT] 2017-08-29 18:20:29 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!