如何实现在ASP.NET中的多语言支持 [英] How to achieve multilingual support in ASP.NET

查看:121
本文介绍了如何实现在ASP.NET中的多语言支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的国际化asp.net应用程序。如何做到这一点?哪些步骤究竟我必须遵循?

I want to internationalize my asp.net application. How to do this? What steps exactly do I have to follow?

推荐答案

简单地做出将从页面类继承的BasePage类,放在BasePage类此方法并继承BasePage类在你的每一个aspx.cs页面来acheive全球化。

Simply make a basepage class that will inherited from Page class, put this method in basepage class and inherit basepage class in your every aspx.cs page to acheive globalization.

 protected override void InitializeCulture() 
{ 
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); 
    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
    base.InitializeCulture(); 
}

在此方法中,你想要的任何文化精神的设置,如AR-SA阿拉​​伯语....

set in this method whatever culuture you want, like ar-sa for arabic....

这篇关于如何实现在ASP.NET中的多语言支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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