C# Creating a setup for multi-language

前端 未结 2 658
离开以前
离开以前 2020-12-17 00:07

I have added multi-language using the short article below.

When you add for example German language you will have these files: formMain.resx formMain.de-DE.resx for

相关标签:
2条回答
  • 2020-12-17 00:15

    I found the answer

    Click the Setup Project in Solution Explorer and then click Add\Project Output\ . From dialog select the project for which you want to include localization (satelite) assemblies and then select Localized resources.

    After the installation in the folder that I install to, I have the th-TH folder which includes the satellite assembly.

    Thanks,

    0 讨论(0)
  • 2020-12-17 00:24

    Try adding in this at the app's startup (if it's not there):

    Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentCulture;
    

    Here is a short article discussing some of the options of how to make this work, and options for selecting the locale at runtime.


    Edit after comments:

    Make sure your satellite assembly is in the appropriate place, and built correctly. From that article I referenced:

    "When .NET runtime starts an application it looks for a possible satellite assembly file. A satellite assembly file is a resource only assembly file that has .resources.dll extension instead of .exe ir .dll (if the main assembly is a library). Satellite assembly files always locate on a language specific sub directory of the applciation's main directory. If application file is Converter.exe then the Japanese satellite assembly file is ja\Converter.resources.dll."

    There are a few things that you should check here. Check the name of the assembly. Also, make sure it's in the proper location. In your case, it should be in a th-TH subdirectory with the appropriate name under your executable. If it's there, it should be found and used properly.

    Here is another good source of information about this topic.

    0 讨论(0)
提交回复
热议问题