Questions tagged [currentculture]

a Thread property in the .NET System.Threading namespace or a CultureInfo property in the .NET System.Globalization namespace

CurrentCulture refers to either the Thread.CurrentCulture property in the .NET System.Threading namespace or the CultureInfo.CurrentCulture property in the .NET System.Globalization namespace.

In both cases, this property is used to get or set the System.Globalization.CultureInfo object that represents the culture of the current thread.

Resources

Related Tags

139 questions
2
votes
0 answers

Impossible to visualize display language with vb.net

I currently make a program in vb.net which needs to know what is the DISPLAY language in windows. I try to visualize it using : CultureInfo.CurrentCulture.Name But when I use it, the value equals to null. The only language I succeed to visualize…
2
votes
1 answer

Set language of standard .NET exception messages

(how) is it possible to display standard .NET exception messages like the SocketException "Network is unreachable" in another language? I thougth it depends on the CurrentCulture but in my App (Android & iOS) the message is always in English even…
2
votes
1 answer

Default string format in Silverlight

I've got a double, for example double d = 4.323d; And I want to display it in a TextBlock on a Silverlight 4 application, but the display should be this: 4.32 And I cannot change the StringFormat on the binding whatsoever. The exception is that if…
Anemoia
  • 7,928
  • 7
  • 46
  • 71
2
votes
1 answer

How to change the culture of a number in C#?

I'm sending parameters to paypal as hidden form vars. but my site's culture is Danish. So "50,00" is the value for "amount_1" I'm using this code that converts the 50 to…
aron
  • 2,856
  • 11
  • 49
  • 79
2
votes
0 answers

.net CultureInfo inconsistent CultureInformation after Windows10 anniversary update

After the Windows10 anniversary update i have a stange problem with CultureInfo and NumberFormat (specially with the NumberGroupSeparator). This sample app shows the problem (My system language is de-at): private static void Main(string[] args) …
feitzi
  • 98
  • 7
2
votes
1 answer

multiple resx files for 1 culture

I have a c# application that needs to support multiple culture types. I have a resx file made for each language, and changing the culture type changes the resx file i'm using. Works great. Now i have a client that doesn't like the labels I've…
Phil
  • 1,852
  • 2
  • 28
  • 55
2
votes
1 answer

How to set current CultureUI via XAML binding

I have a TextBlock bound to a string. I want the string to be displayed in current UI culture of the application. I want to do this in XAML. The text block is simple like below.
Prince Ashitaka
  • 8,623
  • 12
  • 48
  • 71
2
votes
1 answer

How to honor/inherit user's language settings in WinForm app?

I have worked with globalization settings in the past but not within the .NET environment, which is the topic of this question. What I am seeing is most certainly due to knowledge I have yet to learn so I would appreciate illumination on the…
Michael Sorens
  • 35,361
  • 26
  • 116
  • 172
2
votes
2 answers

C# Convert DateTime in the CurrentCulture

How to get CurrectCulture and force converting and converting back a DateTime in this culture. I have tried var myDate = DateTime.Parse(myDate , CultureInfo.InvariantCulture); but it does't work. then I suppose that I must specify the…
Sam
  • 97
  • 10
2
votes
2 answers

Set the Culture for an asp.net RangeValidator

An asp:RangeValidator takes it's culture info from the page/ thread and all advice online around getting the right culture seems to be to set the CultureInfo on the thread. Rick Strahl's west wind blog is typical advice However, due to problems…
DannykPowell
  • 1,227
  • 5
  • 18
  • 30
2
votes
2 answers

.NET CookieException "Cookie format error" when thread culture is not English - only in certain environments

I am trying to do some cookie management in an ASP.NET app that calls other web services. I am encountering an error that I can reproduce only in certain environments. My questions are: Is the difference between production and development enough…
Aaron D
  • 5,817
  • 1
  • 36
  • 51
1
vote
2 answers

DateTime.Parse using culture en-us, despite web.config setting

Question: in web.config in section system.web I have What I want is to parse a string like this "20.03.2012 00:00:00" to a datetime value but…
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
1
vote
3 answers

Translation different from culture and ui culture in asp mvc 3 site

In my ASP MVC 3 site I added a folder Resources with 2 Resx files Strings.resx and Strings.fr-FR.resx, Acces modifier public, and provided translation. I added in web.config:
addex03
  • 197
  • 1
  • 2
  • 12
1
vote
2 answers

Override CurrentCulture for WinForms control

Is it possible to override the CurrentCulture and the CurrentUICulture for a specific control in WinForms? So that this one specific control uses a different culture?
Martin Moser
  • 6,219
  • 1
  • 27
  • 41
1
vote
0 answers

CultureInfo change for all user in Blazor server side

I'm developing an app with blazor server side net 6. the purpose is to have the possibility to select the preferred language for each user. The problem is that when a user changes the language, it changes for all users I added this line in the…