Questions tagged [cultureinfo]

Represents information about a specific culture including the names of the culture, the writing system, and the calendar used, as well as access to culture-specific objects that provide information for common operations, such as formatting dates and sorting strings.

Represents information about a specific culture including the names of the culture, the writing system, and the calendar used, as well as access to culture-specific objects that provide information for common operations, such as formatting dates and sorting strings.

Reference

CultureInfo on MSDN

1135 questions
21
votes
3 answers

How can I display culture-specific native digits instead of Arabic numerals?

I want to convert a numeric value to a string, displaying culture-specific digits. For example, the Dari language used in Afghanistan (culture name "prs-AF") uses Eastern-Arabic numerals instead of the Arabic numerals used in most Western cultures…
Kevin Babcock
  • 10,187
  • 19
  • 69
  • 89
21
votes
3 answers

How to translate CultureInfo language names

I know of three ways to get a full language name of a CultureInfo object. CultureInfo.DisplayName CultureInfo.NativeName CultureInfo.EnglishName DisplayName gives the name in the installed .net language. NativeName gives the name in…
Yodah
  • 283
  • 1
  • 2
  • 7
19
votes
5 answers

datetime.tostring month and day language

i have a list of email addresses of people that have different nationalities (for each person i have the iso code) when i send the email to all these people, in the text of the mail i need to to convert a datetime field to a string formatted in…
pfab.io
  • 273
  • 1
  • 2
  • 11
19
votes
6 answers

Double.Parse - Internationalization problem

This is driving me crazy. I have the following string in a ASP.NET 2.0 WebForm Page string s = "0.009"; Simple enough. Now, if my culture is Spanish - which is "es-ES" - and I try to convert the string to Double, I do the following: double d =…
oz.
  • 2,153
  • 3
  • 16
  • 15
19
votes
3 answers

ToString() default CultureInfo

I think I understand the CultureInfo usage. If I do simple : const int a = 5; string b = a.ToString(); is it equal to : const int a = 5; string b = a.ToString(CultureInfo.InvariantCulture); In other words, does ToString() by default use…
mishap
  • 8,176
  • 14
  • 61
  • 92
19
votes
3 answers

How to get language without country from CultureInfo

Does anyone know in ASP.Net how to get the language of the currentculture without it's countryname? I know this invariant culture's don't have this problem, but I don't know how to create them without specifying an explicit language. I want to…
Peter
  • 14,221
  • 15
  • 70
  • 110
18
votes
6 answers

How to get country name

I used the code below to get the list of culture type, is there a way on how to get just the country name? Thank you static void Main(string[] args) { StringBuilder sb = new StringBuilder(); foreach (CultureInfo ci in…
xscape
  • 3,318
  • 9
  • 45
  • 86
18
votes
7 answers

ToString("0") versus ToString(CultureInfo.InvariantCulture)

I would like to make sure that certain numbers in my application are printed without any separators, groupings etc. no matter what the current environment is. It seems that the following two methods produce the same results (there are possibly…
Jan Zich
  • 14,993
  • 18
  • 61
  • 73
17
votes
1 answer

Why isn't CultureInfo.NativeName always capitalized?

Just out of curiousity... In our application I list all the available translations in the following format "NativeName - EnglishName". For some languages the NativeName isn't capitalized eg. "Deutsch - German" "español - Spanish" "français -…
Stormenet
  • 25,926
  • 9
  • 53
  • 65
17
votes
5 answers

Best Practice - Format Multiple Currencies

What is best practice for the scenario listed below? We have an application which we would like to support multiple currencies. The software will respect the users locale and regional settings to dictate the correct number format, i.e. $10,000.00 or…
Klondike
17
votes
2 answers

Replace German characters (umlauts, accents) with english equivalents

Replace German characters (umlauts, accents) with english equivalents I need to remove any german specific characters from various fields of text for processing into another system which wont accept them as valid. So the characters I am aware of…
jb.
  • 1,848
  • 9
  • 27
  • 43
17
votes
2 answers

Why is the culture name for English (Caribbean) "en-029"?

Why is the culture name for English (Caribbean) "en-029"? I know "en-CA" is used for English (Canada), but why 029? What does it signify? Why was it chosen?
Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
17
votes
3 answers

What is the recommend way to create a custom culture and associated resource files for a specific Client?

I have client that wants to specifiy their own version of localized content for a subset of my string resources. For simplicity here is basic example: Lets say I have 2 localized strings (showing english content) PageTitle="Hello…
Justin
  • 10,667
  • 15
  • 58
  • 79
16
votes
3 answers

String sorting issue in C#

I have List like this List items = new List(); items.Add("-"); items.Add("."); items.Add("a-"); items.Add("a."); items.Add("a-a"); items.Add("a.a"); items.Sort(); string output = string.Empty; …
Satya
  • 163
  • 1
  • 5
15
votes
1 answer

Units of distance for the current CultureInfo in .Net

Is it possible to get the unit of distance from a CultureInfo class or any other class in the System.Globalization namespace. e.g. "en-GB" would be "mile", "en-FR" would be "km"
AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152
1 2
3
75 76