globalization

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

邮差的信 提交于 2019-11-27 12:00:58
问题 How do I make my application always use English when displaying win32/.net exceptions messages? I got this message, it looks like someone used babelfish to translate it (it's Swedish): "System.ComponentModel.Win32Exception: Programmet kunde inte starta eftersom programmets sida-vid-sidakonfiguration är felaktig." Extremely unhelpful, and Google had a whopping 4 hits for it, none of them helpful. So I have to guess what the original message was and google that. (It's was: "The application has

ASP.NET - MVC 3: Localization

耗尽温柔 提交于 2019-11-27 09:50:55
问题 I am about to implement localization for my MVC3 web application. Googling my way through large amounts of ways to do it, I was left unsure which way to implement this. I found few ways how to do it: First option I found was to use App_GlobalResources and ViewData and culture select with Map Routing. (Link) Second was to make a separate Resources folder in my project and structure it like Model and View folders. Then create the resource files in those folders. To use those resource strings

How do I set CultureInfo.CurrentCulture from an App.Config file?

谁说胖子不能爱 提交于 2019-11-27 08:49:15
I need to set my application's culture through an App.Config file, so that "pt-BR" is used automatically for parsing dates without the need to manually inform the culture for each operation. As far as I know, there's a globalization section that can be defined inside the system.web section in a Web.Config file, but I'm running a console application and I can't figure this out. Any idea? Adi Lester I don't know a built-in way to set it from App.config, but you could just define a key in your App.config like this <configuration> <appSettings> <add key="DefaultCulture" value="pt-BR" /> <

Is there a repository for localized common text in WinForms?

天涯浪子 提交于 2019-11-27 08:13:38
问题 I'm globalizing a Windows form application. Is there a way to access common text in the current language for Windows? For example, for the labels of OK, Cancel and Accept buttons; if I'm building a form that has an OK button I would like to use the same translation that Windows uses everywhere else for OK buttons. I know I can store the translation for them myself, but Windows has to have them stored somewhere, do they give developers access to them? 回答1: Yes, theoretically you could extract

From where CultureInfo.CurrentCulture reads culture

假如想象 提交于 2019-11-27 07:44:48
问题 I want to know the setting or location from where System.Globalization.CultureInfo.CurrentCulture reads its value. I am using a windows 7 laptop and have changed my system's regional and date-time settings to US. I got my code working using below setting in web.config under <globalization culture="en-US" /> Thanks 回答1: the MSDN says The culture is a property of the executing thread. This read-only property is equivalent to retrieving the CultureInfo object returned by the Thread

comma decimal seperator in asp.net mvc 5 [duplicate]

我是研究僧i 提交于 2019-11-27 07:17:52
问题 This question already has an answer here: Accept comma and dot as decimal separator [duplicate] 4 answers im desperately trying to make asp.net work with the comma symbol as the decimal seperator but this seems to be a lot harder then necessary... i've done everything that's in this tutorial http://www.asp.net/mvc/overview/getting-started/introduction/examining-the-edit-methods-and-edit-view tried this in the root web config <system.web> <globalization culture="de-DE" uiCulture="de-DE" /> <

How do I use DateTime.TryParse() for non-English languages like Arabic?

青春壹個敷衍的年華 提交于 2019-11-27 06:06:34
问题 I need to convert strings to DateTime objects that are in non-English languages. I've seen many examples of converting DateTime to strings in other languages, but not the other way around. This doesn't seem to work: CultureInfo provider = new CultureInfo("ar-AE"); // Arabic - United Arab Emirates string sample = "الاربعاء 16 مارس 2011"; // Arabic date in Gregorian calendar DateTime result; DateTime expected = new DateTime(2011, 3, 16); // the expected date bool b; b = DateTime.TryParse(sample

how to set default culture info for entire c# application

喜你入骨 提交于 2019-11-27 05:35:26
问题 I want to set default culture info for that class or for entire application. For example in Turkey 3,2 = in english 3.2 so application uses my local but i want it to use as default System.Globalization.CultureInfo.InvariantCulture How can i set it to that as default for that specific class or for entire application 回答1: Not for entire application or particular class. CurrentUICulture and CurrentCulture are settable per thread as discussed here Is there a way of setting culture for a whole

How to set decimal separators in ASP.NET MVC controllers?

我是研究僧i 提交于 2019-11-27 03:35:45
I'm working with the NerdDinner application trying to teach myself ASP.NET MVC. However, I have stumbled upon a problem with globalization, where my server presents floating point numbers with a comma as the decimal separator, but Virtual Earth map requires them with dots, which causes some problems. I have already solved the issue with the mapping JavaScript in my views , but if I now try to post an edited dinner entry with dots as decimal separators the controller fails (throwing InvalidOperationException ) when updating the model (in the UpdateModel() metod). I feel like I must set the

What do I need to know to globalize an asp.net application?

好久不见. 提交于 2019-11-27 01:10:00
问题 I'm writing an asp.net application that will need to be localized to several regions other than North America. What do I need to do to prepare for this globalization? What are your top 1 to 2 resources for learning how to write a world ready application. 回答1: A couple of things that I've learned: Absolutely and brutally minimize the number of images you have that contain text. Doing so will make your life a billion percent easier since you won't have to get a new set of images for every