locked
change GUI language @ runtime RRS feed

  • Question

  • Hi,

     

    How can I a winform to change is display language from user interaction using resx file ?

     

    Thanks

     

    Sylvain

    Tuesday, April 3, 2007 7:57 PM

Answers

  • sydes141,

     

    Please read the following article that can help you:

     

    How to use application resource files (.resx) to efficiently create a localizable ASP.NET Web application

     

    http://support.microsoft.com/kb/917414

     

    You can use application resource files (.resx) to efficiently create a localizable Microsoft ASP.NET Web application. By using resource files, you can store localized values for controls. The localized values are based on a user’s language and culture. When you store localized values in resource files, ASP.NET can select the appropriate value at run time.

     

    A localizable ASP.NET Web application must contain the following:


      A resource file (.resx) to store the localized values


      Coding to associate specific controls with specific localized values

     

    This article contains an implicit location sample that uses a combination of designer resources and editor resources to produce a resource file. This article describes how to use the resource file to create a localizable ASP.NET Web application that you can view in two languages. The method in this article uses Microsoft Visual Studio 2005 to populate the resource file by using values that are based on control properties for each page.

    Tuesday, April 10, 2007 5:44 AM
  • sydes141,

     

    A rough solution.

     

    Get directory name that satellite assembly resides in with System.IO.Directory.

     

    The satellite assembly for each supported culture resides in a sub folder with the name of the corresponding culture. The solution is to get the names of all the sub folders, so as to get what you want.

     

    You can enumerate the different languages in the commboBox.

     

    Thursday, April 19, 2007 2:14 AM

All replies

  • sydes141,

     

    Please read the following article that can help you:

     

    How to use application resource files (.resx) to efficiently create a localizable ASP.NET Web application

     

    http://support.microsoft.com/kb/917414

     

    You can use application resource files (.resx) to efficiently create a localizable Microsoft ASP.NET Web application. By using resource files, you can store localized values for controls. The localized values are based on a user’s language and culture. When you store localized values in resource files, ASP.NET can select the appropriate value at run time.

     

    A localizable ASP.NET Web application must contain the following:


      A resource file (.resx) to store the localized values


      Coding to associate specific controls with specific localized values

     

    This article contains an implicit location sample that uses a combination of designer resources and editor resources to produce a resource file. This article describes how to use the resource file to create a localizable ASP.NET Web application that you can view in two languages. The method in this article uses Microsoft Visual Studio 2005 to populate the resource file by using values that are based on control properties for each page.

    Tuesday, April 10, 2007 5:44 AM
  •  

    Thanks For tour response Bruno,

     

    I already use resx file in my vb.net project. ( It's not web )

     

    What I want is a button in the application that when you click on it, the display language change (french <--> english).

     

    So I can I reload my controls with the new language ?

     

    Thanks

    Wednesday, April 18, 2007 12:14 PM
  • sydes141,

     

    A rough solution.

     

    Get directory name that satellite assembly resides in with System.IO.Directory.

     

    The satellite assembly for each supported culture resides in a sub folder with the name of the corresponding culture. The solution is to get the names of all the sub folders, so as to get what you want.

     

    You can enumerate the different languages in the commboBox.

     

    Thursday, April 19, 2007 2:14 AM
  • I was hopping there was a way to ask the control to reload itself with a new culture so that the text would change automatically.

     

    As I understand, I will have to manually make every control change it's text.

     

    Conclusion, Microsoft should add fonctionnality to reload windows control dynamically with a different language since it's a need in multi language  country.

     

    Thanks.

     

    Thursday, April 19, 2007 12:45 PM