tagged [globalization]

The field must be a number

The field must be a number I have this field: `public decimal Price { get; set; }` in Database it is decimal (7,2). View: If i put a value with comma, MVC default validation doesn't accept, says: `"Th...

Prevent exception messages from being translated into the user's language?

Prevent exception messages from being translated into the user's language? How do I make my application always use English when displaying win32/.net exceptions messages? I got this message, it looks ...

13 Oct at 12:20

CultureInfo & DateTimeInfo: How to check if is 24 hour time?

CultureInfo & DateTimeInfo: How to check if is 24 hour time? I'm modifying a globalized web application which uses stored CultureInfo for each logged in user. The client would like time data entry to ...

16 Jul at 01:25

Regular expression for validating names and surnames?

Regular expression for validating names and surnames? Although this seems like a trivial question, I am quite sure it is not :) I need to validate names and surnames of people from all over the world....

28 Sep at 13:43

Proper way to change language at runtime

Proper way to change language at runtime What is the proper way to change Form language at runtime? 1. Setting all controls manually using recursion like this 2. Save language choice to file > Restart...

How to convert string to double with proper cultureinfo

How to convert string to double with proper cultureinfo I have two nvarchar fields in a database to store the DataType and DefaultValue, and I have a DataType Double and value as 65.89875 in English f...

22 Nov at 05:56

Are there built-in Month name declensions in C#

Are there built-in Month name declensions in C# I'm wondering if there's any built-in functionality in .NET for declining dates in languages that support noun declensions, (ie. In Russian the month na...

When should I specify CurrentCulture or InvariantCulture and when should I leave it unspecified?

When should I specify CurrentCulture or InvariantCulture and when should I leave it unspecified? What is the best practice for specifying CurrentCulture or InvariantCulture and not specifying the cult...

Set a different language for ASP.NET MVC errors

Set a different language for ASP.NET MVC errors I have an ASP.NET MVC application configured for Portuguese, on Visual Studio 2015. While debugging this application, I've set ``, but all errors are sh...

23 May at 10:31

Floating Point Number parsing: Is there a Catch All algorithm?

Floating Point Number parsing: Is there a Catch All algorithm? One of the fun parts of multi-cultural programming is number formats. - - - My first approach would be to take the string, parse it backw...

How can I properly localize Razor Views in ServiceStack

How can I properly localize Razor Views in ServiceStack I am currently getting the prefered Culture from the Accept-Language-HTTP-Header and storing it in the . ``` PreRequestFilters.Add((httpReq, htt...

protobuf-net does not deserialize DateTime.Kind correctly

protobuf-net does not deserialize DateTime.Kind correctly using `protobuf-net.dll` Version 1.0.0.280 When I deserialize a `DateTime` (wrapped in an object), the date/time is ok but the `DateTime.Kind`...

Why is ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ the native name of the U.S.?

Why is ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ the native name of the U.S.? When I use this code: why is `nativeName` then the string `"ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ"` (in [Cherokee](https://en.wikipedia.org/wiki/Cherokee_language))? If I...

Localizing Date Ranges

Localizing Date Ranges Does anyone know how to localize date ranges using C#? In particular, I want to generate "smart" date ranges, so that redundant information is eliminated. Here are some examples...

22 Jul at 05:59

MVC3 globalization: need global filter before model binding

MVC3 globalization: need global filter before model binding Currently, I have a global filter called `GlobalizationFilter` that checks the route values, cookies and browser languages header to determi...

Best practice for localization and globalization of strings and labels

Best practice for localization and globalization of strings and labels I'm a member of a team with more than 20 developers. Each developer works on a separate module (something near 10 modules). In ea...

How to set culture for date binding in Asp.Net Core?

How to set culture for date binding in Asp.Net Core? I have an Asp.Net Core application with MVC. I'm submitting a form with a date on the form. Form looks (roughly) like this: Contr

Why doesn't object have an overload that accepts IFormatProvider?

Why doesn't object have an overload that accepts IFormatProvider? When converting for instance a `decimal` to a `string`, you use the `CultureInfo.InvariantCulture` and pass it as an `IFormatProvider`...

22 Sep at 20:46

Why do I get, "Culture is not supported" and What, if Anything, Should I Do about it?

Why do I get, "Culture is not supported" and What, if Anything, Should I Do about it? I have a breakpoint on the "return" line here: Although it does not crash the app, when I reach that point, I get,...

How can I convert a DateTime to a string with fractional seconds that is localized?

How can I convert a DateTime to a string with fractional seconds that is localized? I have a DateTime object and I want to output the hour, minute, second, and fractional second as a string that is lo...

20 Mar at 20:46

Localization in ASP.Net core MVC not working - unable to locate resource file

Localization in ASP.Net core MVC not working - unable to locate resource file In trying to localize my application, I've followed the steps here: [https://docs.asp.net/en/latest/fundamentals/localizat...

How to use NumberFormatInfo to remove parenthesis for negative values

How to use NumberFormatInfo to remove parenthesis for negative values We're currently using the following for creating US dollar values in our web application: In this example, if dollarValue is 145, ...

23 May at 12:15

What is the best way to handle validation with different culture

What is the best way to handle validation with different culture I am trying to build a multilingual MVC application. I have a form in my application and I have field to enter a cost. I am able to cre...

ASP.NET resource expression not returning correct Culture value

ASP.NET resource expression not returning correct Culture value I'm using the Resource expression directives in an ASP.NET page that has four global resource files, neutral, UK, US and Italian. Howeve...

List of all available languages for Windows .NET framework

List of all available languages for Windows .NET framework I've been searching for the answer over the net, but I don't seem to be able to find a comprehensive list of all languages available for my a...