Localization via satellite assemblies doesn't work for android when the app built in debug mode.
See original GitHub issueDescription
If I run app in debug mode dotnet build -t:Run -f:net6.0-android
it doesn’t show translated message. For dotnet build -t:Run -f:net6.0-android -c:Release
it does.
Project to reproduce - https://github.com/nevse/Maui-Tests-Localization1
Steps to Reproduce
- create app
dotnet new maui -n HumanaizerTests
- add references
<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Humanizer.Core.de" Version="2.14.1" />
</ItemGroup>
- change culture to
de
and use Humanizer to read data localization resources
CultureInfo.CurrentCulture = CultureInfo.CurrentUICulture = new CultureInfo("de");
CounterLabel.Text = DateTime.UtcNow.AddHours(-2).Humanize();
- run the app in debug
dotnet build -t:Run -f net6.0-android
and release modedotnet build -t:Run -f:net6.0-android -c:Release
Version with bug
Preview 12 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11
Did you find any workaround?
No response
Relevant log output
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Localization not working in .NET Maui Android project ...
You can check this isssue about Localization via satellite assemblies doesn't work for android when the app built in debug mode.
Read more >Localization bug - translation files not updated/working in ...
Now in my debugging mode it looks fine, every word is translated and I can change languages. But as soon as we make...
Read more >All you wanted to know about Satellite Assemblies (C# .Net)
Knowing, creating and using satellite assemblies in C# .Net.
Read more >Configure on-device developer options | Android Studio
The Settings app on Android includes a screen called Developer options where you can configure system behaviors that help you profile and debug...
Read more >Create satellite assemblies - .NET
Get started with creating satellite assemblies for .NET apps. A satellite assembly can be easily updated or replaced to provide localized ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/xamarin/xamarin-android/issues/2012 is very old, I wouldn’t focus on that.
This is the first I’ve seen this issue for .NET 6+, I’ll try the sample above.
My guess is the Humanizer library is doing something to cause this issue, but I will check.
This issue was moved to xamarin/xamarin-android#7622