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

string.Format doesn't apply custom formatting on server

I'm doing the follwing: //TimeSpan rebateTime //int percentage string text = string.Format( CultureInfo.CurrentCulture, "Rebate {0}% during {1:hh} h {1:mm} min", percentage, rebateTime; On my dev pc text contains: Rebate 32%…
Carl R
  • 8,104
  • 5
  • 48
  • 80
0
votes
1 answer

How can I detect the device culture settings in a Windows Store App?

I have C# code for as Windows Store app that returns the app language information. If my app is configured to support "fr" and the device is set to that language, then the app determines that the app language information is "fr". But if the app is…
David Rector
  • 958
  • 9
  • 31
0
votes
1 answer

Asp.net datetime culture issue

I have encounter an issue while working with datetime in asp.net. While sending datetime string from an textbox to DateTime according to the Turkish Culture, the datetime format is breaking. For instance; i am sending these parameters on querystring…
Goran Zooferic
  • 371
  • 8
  • 23
0
votes
2 answers

DateTime format in SQL

I am having some problem when trying to format DateTime in Asp.net. I wanted the date to display as 18/1//2014 instead of 18/1/2014 12.00 AM. Here is the code: DataTable dt = new DataTable(); dt.Columns.Add("totalQuantity"); …
user2531590
0
votes
1 answer

GetMonthName().ToString() is not working properly

GetMonthName's virtual ToString method that inside DateTimeFormatInfo class is not working properly.I 'm adding culture code to CultureInfo but it is returning invariant value. DateTimeFormatInfo d = new…
Goran Zooferic
  • 371
  • 8
  • 23
0
votes
1 answer

How can I control number digit substitution in Silverlight?

I've created a special purpose rich text editor in Wpf. There, I have two buttons which control number digit substitution, converting 123 to ١٢٣ or vice versa. The first button does…
Alireza
  • 5,421
  • 5
  • 34
  • 67
0
votes
2 answers

"zh-hk" culture does not output Chinese in ASP.NET, but does output Chinese in WinForms?

I have this C# code: Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureName); dateScale.EndDate.ToString("dd/MMMM", CultureInfo.CurrentCulture); If I set culture to be "zh-HK", in ASP.NET the output is in English. But when the same…
daxu
  • 3,514
  • 5
  • 38
  • 76
0
votes
1 answer

How to change cultureinfo during runtime in Windows Phone?

In windows phone how can I change between 2 cultures inside the app, for example when user clicks on language setting inside app, it should change between English and Arabic, based on the Appresource files I created? I have tried this on button…
Bohrend
  • 1,467
  • 3
  • 17
  • 26
0
votes
1 answer

Can't Load ResourceSet with Given Culture

I want to get resource key values from resource file specified culture info. Here is the code; CultureInfo languageInfo = CultureInfo.CurrentUICulture; ResourceSet rset = myresourceClass.ResourceManager.GetResourceSet(languageInfo, true,…
Serhat Koroglu
  • 1,263
  • 4
  • 19
  • 41
0
votes
2 answers

Is 'culture' (eg. es-MX, en-US) meant to localize website -content- or -appearance-?

is the concept culture (as with .NET CultureInfo) to be used solely in localizing appearance of a website (language, date- and numberformatting etc.), or can it be used for localizing website content (location-bound newsmessages, contactdetails…
Ropstah
  • 17,538
  • 24
  • 120
  • 194
0
votes
2 answers

Order a collection of French strings and leave the empty entries at the end

Actually, another title for the question would be: how to find the character with the highest alphabetical value for the current culture? Take a look at the following code: static void Main(string[] args) { var input = new[] { "cote", "côte",…
Alex Filipovici
  • 31,789
  • 6
  • 54
  • 78
0
votes
1 answer

Will changing CurrentUICulture in a web service affect all users?

I have a web application that's using a set of web services. When an exception is caught on a web service and sent back to the client I need that message to be displayed in the language currently set on the web app. My first thought was to send a…
Erik Karlstrand
  • 1,479
  • 9
  • 22
0
votes
2 answers

String to Custom Type Substitution

I would like to write a function that takes a currencyCode As String input parameter and outputs a custom currencyFormatString. My dilemma is deciding on the best (proper) way to do this. currencyCode is an ISO 4217 Currency Code (e.g. "USD", "GBP",…
Chiramisu
  • 4,687
  • 7
  • 47
  • 77
0
votes
1 answer

Get language name from Cultureinfo.NativeName

I have following code lstLanguage.Items.Add(CultureInfo.GetCultureInfo("en-US").NativeName) lstLanguage.SelectedIndex = 0 When the below code runs Dim strLanguageCode As String = CType(lstLanguage.SelectedItem, CultureInfo).NativeName it throws an…
Nest
  • 341
  • 4
  • 23
0
votes
1 answer

How to change date format culture for c# application which reads Excel

I am reading Excel file by using OLEDBConnection in C#. I want to change current thread culture as per culture of Excel file so I can get dates in culture specific formats. I have used following code but it is not working. It still converts date to…
user2671548
  • 1
  • 1
  • 2
  • 4