2
votes

We have successfully localized our windows-forms application. One form refuses to use the localized resources and is always shown with the embedded resources. I checked the following points:

  • The forms Localizable attribute is true
  • At runtime the UI-culture is set correctly
  • The satellite assembly is in the correct location
  • With SysInternals process explorer I verified that the process uses the satellite assembly
  • I opened the satellite assembly with IL-Spy and checked that it contains the translated resources
  • In the debugger I stepped into Microsofts ComponentResourceManager.ApplyResources Method for a button. It finds the text property but as the code is optimized I cannot see the really interesting things.

All other forms (different assemblies) appear with the correct language, only this one ... I hope someone out there has a helpful idea.

1
Well, debug the Debug build instead.Hans Passant

1 Answers

0
votes

Just stumbled upon the same issue but could solve it.

I just imported the localized resx files into the project. So the *.de.resx were part of the project, but the localized resources were not applied to all forms.

Referring to http://msdn.microsoft.com/library/y99d1cd3%28v=vs.110%29.aspx, the localized resource files should appear beneath the form (as a sub item).

So my solution was: - go through all forms, change language from Default to German and back to Default. - as a result, the *.de.resx files were listed as sub items of the forms - then overwrite the just created *.de.resx files with the localized ones

Then it works for all forms. I have no idea, though, why it worked before for 3 forms out of 4.

What is the recommended way to add a new language to a Windows Forms application? Do I really need to click through all forms of my application for creating the empty resx files for the new language? Of course, I could edit the project file manually...