0

I have a C#-Desktop-app with some GUI that look likes this in the Designer: enter image description here

The Property "Localizable" ist set to True and "Language" is "German". Right now there is only only language (german) but maybe in the futre there will be others as well. When startet the GUI looks like it should - like in the designer.

However the "Error List"-window gave me a warning about "Assembly neutral Language" not set. So I go the project-settings and set it as well to "German" beacuse thats the only supportes language right now. When I start the GUI now it looks messed up: enter image description here

Setting the "Assembly neutral language" to "English" makes the GUI working again but I don't get the point here. Why is it that "German" messes it up?

suriel
  • 191
  • 1
  • 10
  • Perhaps it should be "de" rather than just "de-DE"? What, exactly, did you set for `NeutralResourcesLanguage()`? If your default resources are in a satellite assembly, you might also need to specify `UltimateResourceFallbackLocation.Satellite`, i.e. `[assembly:NeutralResourcesLanguage("de", UltimateResourceFallbackLocation.Satellite)]` – Matthew Watson Oct 06 '21 at 08:46
  • setting "de" or "de-DE" doesn't change anything. Even if I change the Forms Language-Property to english it shows the GUI with the german texts (although the designer shows the english ones). I have files "MainForm.de.resx", "MainForm.en.resx" and "MainForm.resx" and when in messed-up-state it looks like the "MainForm.resx" (without any language) is used – suriel Oct 06 '21 at 11:16

1 Answers1

0

You can try the following.
Add to the AssemblyInfo.cs the following code:

using System.Resources;

[assembly: NeutralResourcesLanguage("de")]

In your MainForm.resx use the German texts instead of the English texts. You may need to add the NuGet package System.Resources.ResourceManager as well if it has not yet been added to your project.

See: c# warning - Mark assemblies with NeutralResourcesLanguageAttribute

Arjan
  • 1