onethreethreeseven
onethreethreeseven

Reputation: 55

Resource (resx) files always returns english (default) strings

Im having some trouble using .resx files. Everything was created using windows MAT toolkit extension (the problem occurred regardless of this).

I have two languages (en and es). When I make a new project and use the code below it works:

System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("es");
string temp = MultilingualResources.strings.Hello;

The string is returned as "Hallo" so the translation works. But when I do this in GoDot (c#) inside visual code, the string always returns in english no matter which culture or UIculture I specify, but the code is exactly the same. I've tried with resource manager and result is the same. So basically it gets the strings.resx values but not strings.es.resx values. The resx files are embedded resources. Any idea why this is happening and how to make this work?

I also tried using

CultureInfo culture = CultureInfo.CreateSpecificCulture("es");
CultureInfo.DefaultThreadCurrentUICulture = culture;

Upvotes: 1

Views: 1016

Answers (1)

The problem started for me after the last visual studio (MAC) update (Version 8.6 (build 4520))

Look this:

https://github.com/xamarin/xamarin-android/issues/4664#issuecomment-632986668

This workaround solved my problem.

But, there is a new preview visual studio update in that solve the problem.

Edit: The problem was solved in the new Visual Studio version

Upvotes: 1

Related Questions