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
0
votes
3 answers

converting arabic date format to english : System.FormatException: 'String was not recognized as a valid DateTime.'

In my c# code, I am getting an Arabic date from a function, I need to convert this date to English format (UK/US). I tried with the following code string startdate = "٢٠١٩-٠٩-٠٣"; var dateTime = DateTime.ParseExact( startdate, "d MMMM yyyy", …
atc
  • 13
  • 3
0
votes
0 answers

Mvc View and HttpPost have different Culture Values

In my View the culture value is right. But in my ajax HttpPost method the culture is wrong. My goal is check url lang if empty check cookie if it is again empty I get the language from client(English,German,Turkish) default is TUrkish if client have…
Alican Kablan
  • 399
  • 8
  • 17
0
votes
1 answer

Best way to allow users to add text in another language

I have a Xamarin Forms app where users enter the pieces of information they want to gather on a form. The user provides a caption for each piece of information. I want to allow the user to enter a caption for each piece of information in multiple…
George M Ceaser Jr
  • 1,497
  • 3
  • 23
  • 52
0
votes
0 answers

How can I localize cultureinfo.DisplayName?

I wanna get the DisplayName of a culturinfo with the language of System.Threading.Thread.CurrentThread.CurrentCulture. example) Thread.CurrentThread.CurrentCulture : English en-US => English zh-CN => Chinese ja-JP =>…
Jeffrey Kang
  • 77
  • 1
  • 8
0
votes
2 answers

Problem to change en-US culture to fa-IR culture in windows form application in window 10 64 bit

The culture of windows form application doesn't change, despite using the correct code (I think of course). In the Program.cs file in the win form application I try to change the current culture from en-US to fa-IR and I use these codes: CultureInfo…
Piroozman
  • 29
  • 9
0
votes
0 answers

JQuery Validation Unobstrousive - Changing Language - MVC 5

I'm struggling with JQuery Validation Unobstrousive, which is already built in with creating an ASP.Net MVC 5 Project. Locally my whole machine is in a german environment. The validation text of JQuery Validation is coming from my data…
sandy
  • 464
  • 1
  • 6
  • 13
0
votes
0 answers

CultureInfo("en-US") does not convert the exception message to English

try { ... } catch (Exception ex) { CultureInfo.CurrentCulture.ClearCachedData(); System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); System.Threading.Thread.CurrentThread.CurrentUICulture = new…
Ursidae
  • 87
  • 9
0
votes
0 answers

Does every shown Windows Form run under its own thread?

Given a Windows Form with manual set Current(UI)Culture "EN-GB". When I open another form out of this by using( FormB form = new FormB() ) { form.ShowDialog( this ); } the FormB has set the Current(UI)Culture of the operating system. Is this…
Powerslave
  • 531
  • 2
  • 7
  • 24
0
votes
1 answer

DatePicker is changing from dd/MM/yyyy to MM/dd/yyyy after input

I'm doing a wpf application and I have two fields where I have to have the date like this: dd/MM/yyyy hh:mm:ss but when I lose focus from the element the date goes to MM/dd/yyyy hh:mm:ss. And This only happens when I change something in the date. If…
0
votes
1 answer

How to display the datetimepicker in another language

I can't get the datetimepicker text to show the abbreviation for the month in another language I changed the regional settings for my PC to Dutch. That changes the month name from May to mei but I don't want to do that. On start…
Miguel Terlaak
  • 175
  • 1
  • 13
0
votes
1 answer

How to get Current culture formatted number currency

Using below way, able to get 2 digit currency for current culture. string.Format(CultureInfo.CurrentCulture, "{0:C2}", amount) getting the result as: $1,000.00 How can we get currency using currency symbol like USD or EUR as below, expected result:…
dsi
  • 3,199
  • 12
  • 59
  • 102
0
votes
2 answers

CultureInfo nb-NO DateTime.TryParse difference in VS2019 and on dotnetfiddle.net

On my machine when I run and output the following string locale = "nb-NO"; CultureInfo culture = CultureInfo.CreateSpecificCulture(locale); string shortDateFormatString = culture.DateTimeFormat.ShortDatePattern; string shortTimeFormatString =…
starcorn
  • 8,261
  • 23
  • 83
  • 124
0
votes
1 answer

Why WPF ignores my CultureInfo.CurrentCulture

I started messing up with MySQL.Data.EntityFramework (8.0.15) and I'm getting wrong date format. In my culture ('pl-PL') date format is "YYYY-MM-DD", but DataGrid shows dates in "MM/DD/YYYY" format by default. My Windows regional settings are…
Kamil
  • 13,363
  • 24
  • 88
  • 183
0
votes
1 answer

Setting CultureInfo when using reflection Invoke

I'm working on a type converter that looks for a Parse method on the target type. It is found without a problem and invokes just fine. The problem is when passing specific CultureInfo to the Invoke method, it has no effect. Demo code: const…
mroach
  • 2,403
  • 1
  • 22
  • 29
0
votes
1 answer

SSRS currency not showing as CAD

Need to show the SSRS currency as CAD 200,000.00 but not able to achieve the same. Changed the text box properties to Custom and Format as "C". If the language is passed "en-US" or "en-CA" the format remains the same i.e. $200,000.00. Please Help!