xamarin/Xamarin.Forms
[Android] CultureInfo does not update when the user changes language choice while the app is running
开放
#4,282 创建于 2018年11月1日
a/l10ne/4 :clock4:help wantedp/Androidt/bug :bug:up-for-grabs
仓库指标
- 星标
- (5,644 个星标)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
Steps to Reproduce
- Create a new app
- Add the following in the constructor of
App.xaml.cs
CultureInfo.CurrentCulture.ClearCachedData();
CultureInfo.CurrentUICulture.ClearCachedData();
var x = CultureInfo.CurrentCulture;
var y = CultureInfo.CurrentUICulture;
- Observe that initially, the culture is set to en-US (assuming you have English US language as your top choice)
- While the app is running, go to Android settings and change your main language to something else and hit apply.
- Go back to the app. Notice that the App constructor is run again, but the culture info is not updated despite us clearing cached data.
- Exit the app and run it again. Observe that the culture info is updated this time.
Ref: #3949 & https://github.com/xamarin/Xamarin.Forms/pull/423
EDIT: RegionInfo.CurrentRegion is not updated either.