Asp.net多语言Web应用程序 - 本地化

时间:2021-08-11 04:11:39

What's your opinion for the best possible way to build asp.net multilingual localized web application (only UI localization of string resources). Especially this two things:

您对构建asp.net多语言本地化Web应用程序(仅限字符串资源的UI本地化)的最佳方式有何看法?特别是这两件事:

  1. How to store resources? Xml files, resx files or something else?
  2. 如何存储资源? Xml文件,resx文件还是其他什么?

  3. How to handle URL's? I don't want to keep language parameter in query string all the time so I need to use URL rewriting maybe?
  4. 如何处理URL?我不想一直在查询字符串中保留语言参数所以我需要使用URL重写吗?

/BR

2 个解决方案

#1


2  

Have you looked into the localization support in ASP.NET? It uses resource assemblies and sets the default resource based on the browser's settings. You can also override the setting by setting the culture and uiculture settings for the thread handling the request.

您是否研究过ASP.NET中的本地化支持?它使用资源程序集并根据浏览器的设置设置默认资源。您还可以通过为处理请求的线程设置culture和uiculture设置来覆盖该设置。

If you don't like using the resource assemblies (which do require a project rebuild when you want to make changes), you can also create a custom resource provider for ASP.NET (this link uses MS Access as an example, you can try to customize it for SQL or some other provider).

如果您不喜欢使用资源程序集(当您想要进行更改时需要重建项目时),您还可以为ASP.NET创建自定义资源提供程序(此链接使用MS Access作为示例,您可以尝试为SQL或其他一些提供程序自定义它。

http://asp.net has some tutorials to get you started, like this one.

http://asp.net有一些教程可以帮助你入门,比如这个。

#2


0  

Use Data Driven ASP.NET Localization Resource Provider as described in http://www.west-wind.com/presentations/wwdbresourceprovider/

使用http://www.west-wind.com/presentations/wwdbresourceprovider/中所述的数据驱动的ASP.NET本地化资源提供程序

#1


2  

Have you looked into the localization support in ASP.NET? It uses resource assemblies and sets the default resource based on the browser's settings. You can also override the setting by setting the culture and uiculture settings for the thread handling the request.

您是否研究过ASP.NET中的本地化支持?它使用资源程序集并根据浏览器的设置设置默认资源。您还可以通过为处理请求的线程设置culture和uiculture设置来覆盖该设置。

If you don't like using the resource assemblies (which do require a project rebuild when you want to make changes), you can also create a custom resource provider for ASP.NET (this link uses MS Access as an example, you can try to customize it for SQL or some other provider).

如果您不喜欢使用资源程序集(当您想要进行更改时需要重建项目时),您还可以为ASP.NET创建自定义资源提供程序(此链接使用MS Access作为示例,您可以尝试为SQL或其他一些提供程序自定义它。

http://asp.net has some tutorials to get you started, like this one.

http://asp.net有一些教程可以帮助你入门,比如这个。

#2


0  

Use Data Driven ASP.NET Localization Resource Provider as described in http://www.west-wind.com/presentations/wwdbresourceprovider/

使用http://www.west-wind.com/presentations/wwdbresourceprovider/中所述的数据驱动的ASP.NET本地化资源提供程序