Search code examples
winformslocalization.net-2.0globalizationresx

Get WinForms app to apply localisation set in user control that exists in another class library


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.


Solution

  • 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.