Skip to content

Commit 5662de4

Browse files
committed
fix: Adding workaround for language bug
1 parent 6d07b8e commit 5662de4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Prefix your items with `(Template)` if the change is about the template and not
88
## 3.10.X
99
- Added Dependency Injection validation in the development environment.
1010
- 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.
1112

1213
## 3.9.X
1314
- Removed unnecessary `IsExternalInit.cs` files.

src/app/ApplicationTemplate.Shared.Views/Configuration/LocalizationConfiguration.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ public bool TryApply()
170170
{
171171
try
172172
{
173+
// We need a special case for Android because the CurrentCulture does not return the correct value after changing the device language.
174+
#if ANDROID
175+
var locale = Java.Util.Locale.Default; // Gets the real system language
176+
var culture = new CultureInfo(locale.ToString());
177+
#else
173178
var culture = CultureInfo.CurrentCulture;
179+
#endif
174180

175181
// Use the settings culture if it is set.
176182
var settingsCulture = GetCulture();

0 commit comments

Comments
 (0)