2

I have a Windows Form Application Project that references a class library containing user controls.

The developer of the class library has set localisation in the same way I do (select a culture from the user control language property then modifying the relevant text properties of the controls e.g. Label.Text).

When the PC culture is change, my Windows Form Application works as expected - the language of text is relative to the pc culture. However, all of the class library user control localisation isn't applied - the language is always English.

How can I get the User Controls in this class library to match the behaviour in my Windows Forms Application project?

Note: I am hoping the answer will be very simple and I don't have to manually set the text in the user control (from the resx file) in the user control initialisation/load event.

Also - the Class Library project is a set of DLL's, they are not included in the solution of my project.

Mr Shoubs
  • 14,629
  • 17
  • 68
  • 107
  • There shouldn't be anything special you have to do to get this behavior; it should just work. Do you have the satellite assemblies for the class library in the correct place? – Kevin Kibler Apr 26 '12 at 13:56
  • @CodeSavvyGeek I thought that too. When I add a reference to the DLL it all gets dragged into the relevant bin folder, so I would have thought so... Can you define correct place? – Mr Shoubs Apr 26 '12 at 14:03
  • 1
    The .NET Framework looks in specific places for satellite assemblies. They should exist in a subdirectory named for the culture of the satellite assembly. – Kevin Kibler Apr 26 '12 at 14:07

1 Answers1

2

Make sure that your satellite assemblies are in the correct location. The files should be organized like this:

MyAssembly.dll
en-US/
    MyAssembly.resources.dll
zh-CN/
    MyAssembly.resources.dll

What is a satellite assembly? gives a good summary of this.

Community
  • 1
  • 1
Kevin Kibler
  • 13,357
  • 8
  • 38
  • 61
  • Thanks, I mistakenly thought these would be pulled in / generated automatically when the dll was compiled. – Mr Shoubs Apr 26 '12 at 14:31