File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
src/app/ApplicationTemplate.Shared.Views/Configuration Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ Prefix your items with `(Template)` if the change is about the template and not
8
8
## 3.10.X
9
9
- Added Dependency Injection validation in the development environment.
10
10
- Cleaned up the persistence configuration files (removed unused parameters and updated documentation).
11
+ - Adding a workaround for a bug with the language change on android.
11
12
12
13
## 3.9.X
13
14
- Removed unnecessary ` IsExternalInit.cs ` files.
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ private static string GetSettingFilePath()
75
75
var folderPath = string . Empty ;
76
76
//-:cnd:noEmit
77
77
#endif
78
- //+:cnd:noEmit
78
+ //+:cnd:noEmit
79
79
80
80
return Path . Combine ( folderPath , "culture-override" ) ;
81
81
}
@@ -170,7 +170,19 @@ public bool TryApply()
170
170
{
171
171
try
172
172
{
173
+ //-:cnd:noEmit
174
+ #if ANDROID
175
+ //+:cnd:noEmit
176
+ // We need a special case for Android because the CurrentCulture does not return the correct value after changing the device language.
177
+ var locale = Java . Util . Locale . Default ; // Gets the real system language
178
+ var culture = new CultureInfo ( locale . ToString ( ) ) ;
179
+ //-:cnd:noEmit
180
+ #else
181
+ //+:cnd:noEmit
173
182
var culture = CultureInfo . CurrentCulture ;
183
+ //-:cnd:noEmit
184
+ #endif
185
+ //+:cnd:noEmit
174
186
175
187
// Use the settings culture if it is set.
176
188
var settingsCulture = GetCulture ( ) ;
You can’t perform that action at this time.
0 commit comments