C#: Change the resource file without re-building?

2019-03-20 17:58发布

For an Asp.Net MVC 3 application, I will use resources files to store my I18N( How-to ).

It's not me which will translate all fields in all language, I juste have to create in one language and create empty language files for the two other language. And in the implementation I will use those three files.

So for the development I've not any problem, but after I've created the website, it's the customer which will translate all those fields. I found a great app which allows to translate from one resx to one other ( SimpleResxEditor ). But now, how can the customer change this resx file in the asp.net website without visual studio? Is there a way to specify in visual studio that we use a "not-embedded" resource file, and changing this file will takes an immediate effect?

1条回答
我只想做你的唯一
2楼-- · 2019-03-20 18:39

You have to create the ressource file via resgen first:

resgen InternationalResources.resx

Output is a .resources file.

After the you have to link the ressource to the assembly via al.exe:

al.exe 
/t:lib 
/culture:de-AT 
/out:"\LocalizeableConsole.resources.dll" 
/embed:InternationalResources.resources,LocalizeableConsole.InternationalResources.de-AT.resources 
/template:"LocalizeableConsole.exe"
/keyf:KeyFile.snk
查看更多
登录 后发表回答