Closed qq1688 closed 1 year ago
After hundreds of tests, I solved the issue by myself...
Two things i made wrong 1, AppResources.th.resx this file name format should be AppResources.th-TH.resx 2, new CultureInfo(parm) parm value should be the name of culture instead of TwoLetterISOLanguageName
var curDeviceLngName = CultureInfo.CurrentUICulture.Name;
var culture = new CultureInfo(curDeviceLngName);
After hundreds of tests, I solved the issue by myself...
Two things i made wrong 1, AppResources.th.resx this file name format should be AppResources.th-TH.resx 2, new CultureInfo(parm) parm value should be the name of culture instead of TwoLetterISOLanguageName
var curDeviceLngName = CultureInfo.CurrentUICulture.Name;
var culture = new CultureInfo(curDeviceLngName);
Description:
I added multi language support for my APP, when i set the "Active config" value to "Debug|Any CPU" in solution properties, then build the test APP in my device, the APP can change the language successful, but when i change the value to "Release|Any CPU", rebuild and make a new apk, then install the APP to my device, the APP can not change the language(eg. change to TH), it always show english which i defined in AppResources.resx
Steps to Reproduce
Try the solution in post: https://github.com/xamarin/xamarin-android/issues/4664,but not working...
The logic to change the language
Expected Behavior
Can change language in release mode included the english(AppResources.resx) and TH(AppResources.th.resx)
Actual Behavior
Can only show language from AppResources.resx
Basic Information
Microsoft Visual Studio Professional 2019 Version 16.11.21 VisualStudio.16.Release/16.11.21+33027.164 Microsoft .NET Framework Version 4.8.09032
Xamarin 16.11.000.197 (d16-11@6934992) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 16.11.0.47 (remotes/origin/d16-11@e0d612363) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin.Android SDK 12.0.0.3 (d16-11/f0e3c2d) Xamarin.Android Reference Assemblies and MSBuild support. Mono: c633fe9 Java.Interop: xamarin/java.interop/d16-11@476bb5b ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@87af37b