Culture Info
-
I am developing an home page which can be access from 5 countries. Based on user location (which i don't know it could be Country A, B, C , D or E) i need to change home page accordingly. By default we will have country A. My boss says try to explore culture...but i have no idea for the same...Could you please show some directon.... Thanks Thanks
-
I am developing an home page which can be access from 5 countries. Based on user location (which i don't know it could be Country A, B, C , D or E) i need to change home page accordingly. By default we will have country A. My boss says try to explore culture...but i have no idea for the same...Could you please show some directon.... Thanks Thanks
You can create a CultureInfo object from a culture identifier or culture name. Example:
CultureInfo culture = new CultureInfo("en-GB");
You just have to find out what culture the user preferres. The Accept-Language header in the HTTP headers might be one way to find this out. You use theCultureInfo
object whenever you format any data that is culture dependant, for example in thestring.Format
ordouble.ToString
methods. Example:labelPrice.Text = price.ToString("C2", culture);
--- single minded; short sighted; long gone;
-
You can create a CultureInfo object from a culture identifier or culture name. Example:
CultureInfo culture = new CultureInfo("en-GB");
You just have to find out what culture the user preferres. The Accept-Language header in the HTTP headers might be one way to find this out. You use theCultureInfo
object whenever you format any data that is culture dependant, for example in thestring.Format
ordouble.ToString
methods. Example:labelPrice.Text = price.ToString("C2", culture);
--- single minded; short sighted; long gone;
I am using this Response.Write(CultureInfo.CurrentCulture.ThreeLetterISOLanguageName); and everytime is shows USA....I tried to change the settings from control panel-->regional and language options.... But no luck!! thanks
-
I am using this Response.Write(CultureInfo.CurrentCulture.ThreeLetterISOLanguageName); and everytime is shows USA....I tried to change the settings from control panel-->regional and language options.... But no luck!! thanks