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

断了今生、忘了曾经 提交于 2019-12-21 02:20:14

问题


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:


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


来源:https://stackoverflow.com/questions/7991178/c-change-the-resource-file-without-re-building

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!