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

CultureInfo : display the language with its own culture

The title may not be very clear but what I want to do is really simple: I want to display a list of culture by their names like this: English for culture "en" Deutsch for culture "de" Français for culture "fr Italiano for culture "it" Español for…
G.Dealmeida
  • 325
  • 3
  • 14
0
votes
0 answers

Parse next century Date "27-Jun-2118" C# Try Parse

I want to parse this date "27-Jun-2118". I don't know why my code is not parsing this date. After looking around. I found out that it depends on Culture but I was unable to find out maximum date i can parse and more about culture. string endDatep =…
Charlie
  • 4,827
  • 2
  • 31
  • 55
0
votes
1 answer

Change thread culture .NET Framework 4.6 and later versions

I'm trying to change a new thread CultureInfo like the sample below but: Attempt1: SetCulture1() is not changing my thread Attempt2: SetCulture2() I got the exception "System.InvalidOperationException: instance is read-only" (when set…
idenardi
  • 600
  • 1
  • 6
  • 20
0
votes
1 answer

Excel vba converting date to different format when OS culture is set to UK

In Excel VBA I am assigning a hard coded date to a named range as below: Worksheets("Main").Range("Effectivedate").Value ="11/12/2018" This is been triggered on a button Click. Now I have my system culture as UK. When I click the button the value…
user2081126
  • 77
  • 1
  • 11
0
votes
1 answer

Getting CultureInfo from RegionInfo.TwoLetterISORegionName

In db I already have stored values with RegionInfo.TwoLetterISORegionName values. Atm I have values like 'be' for Belgium, 'no', 'gb', 'en' etc. If I write: var culture = new CultureInfo("be"); instead of Belgium, I get Belarus. So I need a way to…
petko_stankoski
  • 10,459
  • 41
  • 127
  • 231
0
votes
2 answers

DateTime.Parse throws FormatException regardless of CultureInfo

My machine is configured with European date format: dd/MM/yyyy When running any of the following lines: DateTime.Parse("11/15/2017 12:00:00 AM"); DateTime.Parse("11/15/2017 12:00:00 AM",…
Mugen
  • 8,301
  • 10
  • 62
  • 140
0
votes
1 answer

HijriCalendar does not exist

I am trying to get the current Hijri date in my Xamarin app. I tried: Calendar hijri = new HijriCalendar(); and Calendar hijri = new HijriCalendar(); but getting: Error CS0246: The type or namespace name 'HijriCalendar' could not be found (are…
0
votes
2 answers

Converting CultureInfo currency between Saudi Arabia & US

I have something like: price_2.Text = CDbl(price_2.Text).ToString("C", current_culture) Issue/Workflow: And lets assume the beginning price is in dollars so lets say price_2.Text is $5.99. And when pressing a button the current_culture will change…
Omid CompSCI
  • 1,861
  • 3
  • 17
  • 29
0
votes
2 answers

How to apply cultureinfo (language) property to WPF richtextbox selection

I usually can find solutions somewhere on the web, and mostly here at SO. I have tried for two days now to resolve this issue with all attempts yielding the very same results. Hopefully someone here can provide the help I need. I have not added…
0
votes
1 answer

How to get the country code using country name

I want to be able to get country code using country name. As of now I'm doing this: var regions = CultureInfo.GetCultures(CultureTypes.SpecificCultures) .Select(x => new RegionInfo(x.LCID)); var selectedRegion =…
coders
  • 719
  • 1
  • 11
  • 35
0
votes
0 answers

the translation of the data is not valid

the datatable should send me the following data (Compte sociétaire) but it sends me back (Compte socié\u0082taire), what do I miss in my code to have the correct formatting? Req = "select lib as libel from mvt order by lib"; …
dudu
  • 1
  • 1
0
votes
2 answers

Using CultureInfo native numbers instead of english version

I'm going tell to my WinForms application to use CultureInfo native numbers instead of system numbers (e.g. English version) to show numeric/digits. So is there any approach to do this? Thread.CurrentThread.CurrentCulture = new…
Sadegh
  • 4,181
  • 9
  • 45
  • 78
0
votes
1 answer

Localize Windows Service

I want to Set Culture for Windows Service that I developed. Can someone recommend me a good read for or how to go about it. So far I have I Tried to do the Following OnStart() Dim oCultureInfo as CultureInfo = New…
0
votes
1 answer

Windows Culture Settings: apostrophe vs right single quotation mark

All of a sudden, some test turned red on my machine and failed with the message: Input string was not in a correct format. These tests take a bunch of numbers and strings and compare them with a given culture (like "de-CH" here): [TestCase(12345.67,…
Waescher
  • 5,361
  • 3
  • 34
  • 51
0
votes
0 answers

One app uses comma one uses full-stop/period for double values after publish

I have 2 ASP MVC applicataions sitting on the same server, in different app pools. One is public facing and the other is just for users of the internal network. They both query the same database and run under the same user profile. When debugging…
Bassie
  • 9,529
  • 8
  • 68
  • 159