ResX localisation issue (android, avalonia)

The ResX files on android don't seem to be loading on the android app, they work fine on linux and windows but android just only accepts the default culture and doesn't show anything else no matter what language I choose. What I tried (none of these worked). (Resources is the locale resource.) 1 Changing Thread Culture.
Resources.Culture = new CultureInfo(_language);
Thread.CurrentThread.CurrentCulture = Resources.Culture;
Thread.CurrentThread.CurrentUICulture = Resources.Culture;
Resources.Culture = new CultureInfo(_language);
Thread.CurrentThread.CurrentCulture = Resources.Culture;
Thread.CurrentThread.CurrentUICulture = Resources.Culture;
2 Manual testing of my resource on button press.
[RelayCommand]
private void Test()
{
_notificationService.SendNotification(Resources.Test);
}
[RelayCommand]
private void Test()
{
_notificationService.SendNotification(Resources.Test);
}
3 Setting Custom Tool Namespace to VoiceCraft.Client.Locales 4 Setting build options on each ResX file to AvaloniaResource (this crashed the application) 5 Setting build options on each ResX file to EmbeddedResource (including ones dependent on the parent).
No description
No description
10 Replies
Sehra
Sehra2w ago
try using PublicResXFileCodeGenerator instead
SineѶeҀҬOӶ⒉⓸⎤ᚙ▟ ▞╸
already did that
No description
SineѶeҀҬOӶ⒉⓸⎤ᚙ▟ ▞╸
I'm gonna see if I can manually load them...
Sehra
Sehra2w ago
maybe case sensitive, like ja-JP
SineѶeҀҬOӶ⒉⓸⎤ᚙ▟ ▞╸
istg if that works. I'm gonna fucking lose my mind nope. didn't work
SineѶeҀҬOӶ⒉⓸⎤ᚙ▟ ▞╸
weird... no embedded resources...
No description
SineѶeҀҬOӶ⒉⓸⎤ᚙ▟ ▞╸
Updating avalonia didn't do shit... well this is annoying. Imma just leave it for now Fixed it. I just changed entirely to a JSON localizer system and it worked
Denis
Denis2w ago
I've always had issues with Resx. I've written my own localization library that uses source generators to create properties for type safe access of localized strings Highly recommend trying to achieve that too. Did that also for images

Did you find this page helpful?