question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Localization via satellite assemblies doesn't work for android when the app built in debug mode.

See original GitHub issue

Description

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 debugVsRelease

Steps to Reproduce

  1. create app dotnet new maui -n HumanaizerTests
  2. add references
<ItemGroup>
        <PackageReference Include="Humanizer.Core" Version="2.14.1" />
        <PackageReference Include="Humanizer.Core.de" Version="2.14.1" /> 
</ItemGroup>
  1. 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();
  1. run the app in debug dotnet build -t:Run -f net6.0-android and release mode dotnet 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:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jonathanpepperscommented, Nov 10, 2022

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.

0reactions
mattleibowcommented, Dec 8, 2022

This issue was moved to xamarin/xamarin-android#7622

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found