Questions tagged [culture]

Culture is the combination of language and peculiarities of geographical location (like en-UK, en-US, de-AT, de-DE, fr-BE)

Culture is the combination of language and peculiarities of geographical location (like en-GB, en-US, de-AT, de-DE, fr-BE)

815 questions
18
votes
1 answer

Is possible to obtain the CSV separator from Thread.CurrentThread.CurrentCulture? (.NET)

In languages where the decimal separator is a ,(comma) the CSV (comma separated values file format) separator is a ; (semicolon). I know where to find this configuration in the Windows Control Panel, but I don't know how to find it progamatically in…
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
18
votes
6 answers

.NET How to compare two Strings that represent filenames ignoring case correctly

Given that (at least on NTFS) the filesystem on Windows is case insensitive, I would like to compare String fileA to String fileB as such: fileA.Equals(fileB, StringComparison.CurrentCultureIgnoreCase) The question then becomes which culture I…
Marcus
  • 181
  • 1
  • 3
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
16
votes
2 answers

Parse DateTime in c# from strange format

if i have a datetime string in a weird format, such as YYYY##MM##DD HH**M**SS, how can i create a new datetime object base on that? i have read something about the datetimeformatinfoclass but not sure how to get it working..
Grant
  • 11,138
  • 32
  • 94
  • 140
15
votes
1 answer

Formatting number in European format with two decimals

Trying to format a number to two decimals format in European culture. So that comma is decimal separator and space thousands separator. In example 213245 should be formatted as 213 245,00 How can I do that? 213245.toFixed(2).toLocaleString();…
anmatika
  • 1,581
  • 3
  • 21
  • 29
15
votes
3 answers

C# float.tryparse for French Culture

I have a user input which can contain float values ranging from : 3.06 OR 3,06 The culture we are in is French and thus when the user inputs 3.06 and I run a float.tryParse over this value it does not get converted to 3.06 into a new variable (type…
Murtaza Mandvi
  • 10,708
  • 23
  • 74
  • 109
15
votes
2 answers

If you have an application localized in pt-br and pt-pt, what language you should choose if the system is reporting only "pt" code?

If you have an application localized in pt-br and pt-pt, what language you should choose if the system is reporting only pt code (generic Portuguese)? This question is independent of the nature of the application, desktop, mobile or browser based.…
sorin
  • 161,544
  • 178
  • 535
  • 806
15
votes
6 answers

How to change culture to a DateTimepicker or calendar control in .Net

How to set internationalization to a DateTimepicker or Calendar WinForm control in .Net when the desire culture is different to the one installed in the PC?
Oscar Cabrero
  • 4,168
  • 8
  • 29
  • 49
15
votes
1 answer

Need to have date mask depending on the culture in jquery

MVC pages with culture depending on the user. In Search option (search can be done by DueDate), I need to have a mask on that DueDate text box. Mask must be dependant on the user's culture. In both js and cshtml have an error saying: mask.split is…
agmawe
  • 151
  • 4
14
votes
2 answers

Debug.WriteLine() versus Console.WriteLine() handles culture differently. Why?

Consider the following Console App code: Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB"); Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture; DateTime date = new DateTime(2014, 01,…
Matthew Watson
  • 104,400
  • 10
  • 158
  • 276
14
votes
2 answers

Is Culture in C# equivalent to Locale in Java?

C# uses the concept of Culture. Is this operationally similar to Locale in Java or are there significant differences in the underlying concepts?
peter.murray.rust
  • 37,407
  • 44
  • 153
  • 217
13
votes
1 answer

TextBox doesn't honor System Decimal (Dot or Comma)

If I bind Text in a TextBox to a float Property then the displayed text doesn't honor the system decimal (dot or comma). Instead it always displays a dot ('.'). But if I display the value in a MessageBox (using ToString()) then the correct System…
Fredrik Hedblad
  • 83,499
  • 23
  • 264
  • 266
13
votes
5 answers

C# double.TryParse with InvariantCulture returns unexpected result

I'm trying to unit test a getprice method using NUnit. I am stuck with parsing the rawprice into double. My cultureinfo is en-US but I set it to de-DE for this test. Double parsing with numberstyles.any and invariantculture returns unexpected…
Wylan Osorio
  • 1,136
  • 5
  • 19
  • 46
13
votes
2 answers

Code Analysis/FxCop CA1726:UsePreferredTerms showing Cancelled as Deprecated

I'm in the UK where we spell Cancelled with two L's. I want to use the Code Analysis rule "CA1726:UsePreferredTerms" but I don't want it to flag up "Cancelled" as a violation. I have tried adding en-GB to…
user1069816
  • 2,763
  • 2
  • 26
  • 43
13
votes
1 answer

What is the best way to compare two CultureInfo instances?

Background: I have a problem with a component, which changes the current thread culture to "en-US" every time after a call to a specific method of it. Further in my process that leads to problems, e.g. the data access layer is no more working…
Kr15
  • 595
  • 1
  • 6
  • 22
1 2
3
54 55