在Visual Studio 2008中的ASP.NET Web应用程序项目中设置本地化的最佳实践是什么

时间:2022-03-25 04:11:33

I feel like i am completely missing something because I am not able to find any examples describing what i want to do.

我觉得我完全错过了一些东西,因为我无法找到描述我想做什么的任何例子。

I have a fairly plain jane ASP.NET web application project that I want to localize. I'd like the output to have satellite dlls so that later when I want to add a language I can just drop in a new DLL.

我有一个相当简单的jane ASP.NET Web应用程序项目,我想要本地化。我希望输出有卫星dll,以便以后当我想添加一种语言时,我可以放入一个新的DLL。

I have created resx files under App_GlobalResources for the default culture and spanish. When I compile tho, I am not getting a subdirectory under my bin for ES.

我在App_GlobalResources下创建了resx文件,用于默认文化和西班牙语。当我编译时,我没有在ES的bin下获得一个子目录。

If i want to add German or French in the future without a recompile of my web app, how is this done?

如果我想在未来重新编译我的网络应用程序时添加德语或法语,这是怎么做到的?

Many things are pointing to AL.exe but I haven't seen any example of anyone using it in an ASP.NET application. I'm not finding any articles indicating how to set up a localized project/solution in Visual Studio.

许多事情都指向AL.exe,但我还没有看到任何人在ASP.NET应用程序中使用它的任何示例。我没有找到任何文章说明如何在Visual Studio中设置本地化的项目/解决方案。

2 个解决方案

#1


Try this article:

试试这篇文章:

http://www.codeproject.com/KB/aspnet/aspnet-using-localization.aspx

HTH

Colby Africa

#2


I figured out what was happening. After I used visual studio to add a new resources file, it added it with a build action of content. If changed to Embedded resource, the x.resources.dll will be built in the correct culture directory. You should also set the Access Modifier to public (I'm pretty sure this is necessary or your main dll won't be able to connect to the culture resource). This will have the effect of changing the Custom Tool property to PublicResXFileCodeGenerator.

我弄清楚发生了什么。在我使用visual studio添加新资源文件后,它添加了内容的构建操作。如果更改为Embedded资源,则x.resources.dll将构建在正确的culture目录中。您还应该将Access Modifier设置为public(我很确定这是必要的,否则您的主dll将无法连接到culture文件资源)。这将具有将自定义工具属性更改为PublicResXFileCodeGenerator的效果。

#1


Try this article:

试试这篇文章:

http://www.codeproject.com/KB/aspnet/aspnet-using-localization.aspx

HTH

Colby Africa

#2


I figured out what was happening. After I used visual studio to add a new resources file, it added it with a build action of content. If changed to Embedded resource, the x.resources.dll will be built in the correct culture directory. You should also set the Access Modifier to public (I'm pretty sure this is necessary or your main dll won't be able to connect to the culture resource). This will have the effect of changing the Custom Tool property to PublicResXFileCodeGenerator.

我弄清楚发生了什么。在我使用visual studio添加新资源文件后,它添加了内容的构建操作。如果更改为Embedded资源,则x.resources.dll将构建在正确的culture目录中。您还应该将Access Modifier设置为public(我很确定这是必要的,否则您的主dll将无法连接到culture文件资源)。这将具有将自定义工具属性更改为PublicResXFileCodeGenerator的效果。