C#:更改资源文件而不重新构建? [英] C#: Change the resource file without re-building?

查看:380
本文介绍了C#:更改资源文件而不重新构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Asp.Net MVC 3应用程序,我将使用资源文件存储我的I18N(

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

不是我要翻译所有语言的所有字段,我只需要用一种语言创建并为其他两种语言创建空的语言文件.在实现中,我将使用这三个文件.

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

对于开发而言,我没有任何问题,但是在创建网站后,将由客户来翻译所有这些字段.我找到了一个很棒的应用程序,它可以将一个resx转换成另一个( SimpleResxEditor ).但是现在,客户如何在没有Visual Studio的情况下在asp.net网站上更改此resx文件?在Visual Studio中,有没有一种方法可以指定我们使用非嵌入式"资源文件,而更改该文件将立即生效?

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?

推荐答案

您必须首先通过resgen创建资源文件:

You have to create the ressource file via resgen first:

resgen InternationalResources.resx

输出是一个.resources文件.

Output is a .resources file.

之后,您必须通过al.exe将资源链接到程序集:

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

这篇关于C#:更改资源文件而不重新构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆