globalization

choosing NLS_LANG for Oracle

ぃ、小莉子 提交于 2019-12-12 21:40:23
问题 According to the site, http://www.dba-oracle.com/t_nls_lang.htm Problem might occur even if both the database and the client use the same characterset(AL32UTF8). I couldn't understand how this can be possible. Quoting from the site: For example, suppose that the database character set is AL32UTF8, the client is an English Windows operating system, and the NLS_LANG setting on the client is AL32UTF8. Data coming into the database is encoded in WE8MSWIN1252 and is not converted to AL32UTF8 data

How can I change the System.Globalization.CultureInfo.CurrentUICulture in my .NET 4.0 web application?

橙三吉。 提交于 2019-12-12 21:17:27
问题 It seems that I have problem changing System.Globalization.CultureInfo.CurrentUICulture value according to the user preferences (.NET 4.0 web application). In my web application, I have two buttons. One for the Greek Language and one for the English language. When the buttons are clicked, a request goes to the server asking to change the user preferred language. For Greek, I send "el-GR" and for English, I send "en-US". On the server side, I use the following piece of code to change the

Parsing decimal with thousands separator

本秂侑毒 提交于 2019-12-12 15:30:32
问题 I have the following block of code: string price = "1,234.56"; decimal value = 0; var allowedStyles = (NumberStyles.AllowDecimalPoint & NumberStyles.AllowThousands); if (Decimal.TryParse(price, allowedStyles, CultureInfo.InvariantCulture, out value)) { Console.log("Thank you!"); } else { throw new InvalidFormatException(); } Ultimately, price will either be in US style (i.e. 1,234.56) or German style (i.e. 1.234,56). My challenge is right now, Decimal.TryParse fails. I suspect its because of

WPF double valued data binding with custom decimal separator

最后都变了- 提交于 2019-12-12 12:32:11
问题 Is there a centralized way to have the WPF UI to respect the customized decimal separator set in Control Panel -> Regional Settings? When I bind a double valued data to a text box, I want to enter the value using the decimal separator set in Regional settings. The code below (when put in App's ctor) will use the decimal separator of the current culture settings, but will not respect the customized decimal separator setting. I was hoping that this code could somehow easily be exteded to cover

.NET Globalization IsWeekend? [duplicate]

牧云@^-^@ 提交于 2019-12-12 12:26:02
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Finding weekend days based on culture Is there any locale info available in .NET to know if a given date falls on a weekday or a weekend ? i would use the function: public Boolean IsWeekend(DateTime value, CultureInfo cultureInfo) { return (value.DayOfWeek == DayOfWeek.Saturday || value.DayOfWeek == DayOfWeek.Sunday); } But it returns invalid results for some cultures. Has .NET already done the work to compile

Localized region/country names in .NET

♀尐吖头ヾ 提交于 2019-12-12 12:23:31
问题 Is it possible to retrieve a localized name of a country in .NET? The RegionInfo class has only the EnglishName, DisplayName and NativeName - but it doesn't seem to be possible to get for example the local Danish name for "Austria" which is "Østrig". They will always return the English name, no matter which Culture or UICulture the thread runs with. Is there a technique I can use, or will I have to create a data store for that? 回答1: The localized names are only available if the framework has

The field must be a number

血红的双手。 提交于 2019-12-12 08:31:14
问题 I have this field: public decimal Price { get; set; } in Database it is decimal (7,2). View: @Html.EditorFor(model => model.Price, new { htmlAttributes = new { @class = "form-control" } }) If i put a value with comma, MVC default validation doesn't accept, says: "The field must be a number" . (I tried use a Regex, but no way) For example: 5,00, 55,00 or 555,00 Also this: public DateTime date { get;set; } View: @Html.EditorFor(model => model.Date, new { htmlAttributes = new { @class = "form

Externalizing the translation of a WinForms application?

巧了我就是萌 提交于 2019-12-12 08:16:04
问题 I'm working on an application that will be deployed in a lot of different countries, which of course means different languages. The thing is that I would not translate it myself, nor the other developers. One of the user will translate it and he won't have access to Visual Studio. The question is, how to do that? Is there a tool available to edit resx files and seeing the text in the context of the application? Moreover, is it possible to add a translation file to the already compiled

Globalize an existing Windows Forms application?

随声附和 提交于 2019-12-12 07:30:56
问题 I have an existing winforms application developed using VS 2005 and .net framework 2.0. Now we need to globalize this application. The two locales are German and Japanese. I know we can use form's localize property to create localized form resources and can have other resource files for strings used in message boxes, exceptions etc.. I want to know the best approach to globalize an existing application, should I set the localize property on each form or is there some tool which will extract

Globalization in ASP.Net MVC 3

喜夏-厌秋 提交于 2019-12-12 07:06:31
问题 I am trying to achieve globalization/localization in my MVC 3 application. I don't want different Views for each language. Please suggest how I can proceed. Any supported links/URLs will be of great help. 回答1: You localize it in the same way as any other application like this: Create a folder, call it e.g. Resources Right click the folder and add class... choose resource file. Call it anything you like e.g. Strings.resx Under the properties of file, change Custom Tool to be