使用asp.net 3.5和C#的主页的Web应用程序全球化 [英] Globalization of web application having master pages using asp.net 3.5 and C#

查看:117
本文介绍了使用asp.net 3.5和C#的主页的Web应用程序全球化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题?

首先,我想要全球化和本地化之间的明显区别?本地化仅被称为全球化(从下拉列表或链接按钮或任何其他控件中将用户选择的应用程序转换为不同语言的机制)
 称为全球化)

First I want clear difference between Globalization and Localization? Is Localization only called globalization(mechanism of converting application to different language on user selection from dropdown or link button or any other control  is called globalization)

&安培;其次,我想使用c sharp 3.0开发一个asp.net 3.5网络应用程序,其中坐在法国的用户将看到法语,而使用我的网络应用程序的其他用户可以自动查看葡萄牙语,而无需任何下拉选项
,如果找不到匹配的国家/地区,则默认值应为 英语。我已经使用本地化来实现这一点,用户从主页中的下拉列表中选择了首选的语言,并且子页面的内容发生了变化,但我希望
自动我的网络应用程序应该以该国家/地区的特定语言打开用户访问我的Web应用程序的位置。我还应该为用户提供选择其他语言的选项,用户希望看到我的网络
申请。

& Second I want to develop an asp.net 3.5 web application using c sharp 3.0 where the user sitting in France will see  in French and the other user using my web application can see in Portuguese automatically without any drop down selection and if no match found for the country then default should be English. I have achieved this thing using Localization on user selecting there preferred language from dropdown in master page and the content of the child page changes, but I want that automatically my web application should open in that particular language of country from where the user is accessing my web application. I should  also give user an option to select other language  that the user wants to see my web application.

prince16in2002@gmail.com

prince16in2002@gmail.com

推荐答案


  1. "全球化是设计和开发适用于多种文化和本地化的应用程序的过程是为给定的文化和区域设置自定义应用程序的过程。本节中的主题描述了如何创建可以适应不同语言和文化的
    ASP.NET Web应用程序。" 
  2. 试试这个:

//Language
public static CultureInfo ResolveCulture()
{
  string[] languages = HttpContext.Current.Request.UserLanguages;
 
  if (languages == null || languages.Length == 0)
    return null;
 
  try
  {
    string language = languages[0].ToLowerInvariant().Trim();
    return CultureInfo.CreateSpecificCulture(language);
  }
  catch (ArgumentException)
  {
    return null;
  }
}

//Country
public static RegionInfo ResolveCountry()
{
  CultureInfo culture = ResolveCulture();
  if (culture != null)
    return new RegionInfo(culture.LCID);
 
  return null;
}





这篇关于使用asp.net 3.5和C#的主页的Web应用程序全球化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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