Questions tagged [globalization]

The process of making an application suitable for use for a world-wide audience, regardless of culture.

Cultures world-wide differ in many ways beyond the language spoken by users.

Globalization (or globalisation) is the process of making software appropriate for many different cultures. This might include

  • ensuring left-to-right and right-to-left character sets and display layouts are supported
  • different sort orders and search conventions are honoured
  • using non-pejorative user interface conventions, e.g. avoiding use of certain colours
  • understanding different conventions for people's names
  • recognising different ways to identify buildings and companies

It can be contrasted with localization, which is the process of tailoring software software for a particular locale.

1436 questions
18
votes
7 answers

ToString("0") versus ToString(CultureInfo.InvariantCulture)

I would like to make sure that certain numbers in my application are printed without any separators, groupings etc. no matter what the current environment is. It seems that the following two methods produce the same results (there are possibly…
Jan Zich
  • 14,993
  • 18
  • 61
  • 73
18
votes
4 answers

How can I change the CurrentCulture of the entire process (not just current thread) in .Net?

I have a situation where I need to set my process' locale to en-US. I know how to do this for the current thread: System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US"); But my…
Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203
18
votes
3 answers

How to parse string to decimal with currency symbol?

I have no idea why this is not working: string s = "12,00 €"; var germanCulture = CultureInfo.CreateSpecificCulture("de-DE"); decimal d; if (decimal.TryParse(s, NumberStyles.AllowCurrencySymbol, germanCulture, out d)) { // i want to get to this…
Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
15
votes
1 answer

Units of distance for the current CultureInfo in .Net

Is it possible to get the unit of distance from a CultureInfo class or any other class in the System.Globalization namespace. e.g. "en-GB" would be "mile", "en-FR" would be "km"
AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152
15
votes
9 answers

Formatting Numbers as Strings with Commas in place of Decimals

I have the following number: 4.3 I'd like to display this number as 4,3 for some of our European friends. I was under the impression that the following line would do the trick: string ret = string.Format("{0:0,0}", 4.3); // returns "04", not…
DaveDev
  • 41,155
  • 72
  • 223
  • 385
15
votes
5 answers

How to include Variables in Localized Strings?

I'm trying to display a message to the user along the lines of: "User 5 could not be added" But how can I add variables to a string that is being placed in a .resx file? I've trying searching for things like "Variables in Localization"…
DTI-Matt
  • 2,065
  • 9
  • 35
  • 60
14
votes
1 answer

Why do commas behave differently in int.Parse() and decimal.Parse() with InvariantCulture?

Why does: decimal.Parse("1,2,3,45", CultureInfo.InvariantCulture) return a decimal of 12345, yet: int.Parse("1,2,3,45", CultureInfo.InvariantCulture) throws an exception? I would expect the commas to be treated the same for the same culture. If…
Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
14
votes
1 answer

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 determine the correct culture settings for the request: public override void OnActionExecuting(ActionExecutingContext…
Zruty
  • 8,377
  • 1
  • 25
  • 31
14
votes
7 answers

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

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…
Larry Foulkrod
  • 2,254
  • 3
  • 23
  • 25
14
votes
3 answers

How to get language's full name from languageCode? (e.g: from 'en' to 'English')

I'm looking for the dart equivalent of this SO question/answer: Get language name in that language from language code In other words I'd rather avoid going manually one by one of checking if langCode=='en' return 'English' else if langCode == 'fr'…
Agon Noga
  • 563
  • 1
  • 9
  • 17
14
votes
2 answers

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 shown in Portuguese, and I want to see them in English. I tried to set…
Marcos Dimitrio
  • 6,651
  • 5
  • 38
  • 62
14
votes
1 answer

app.config globalization

web.config allow a globalization tag: This setting will set the globalization for the entire ASP.NET application. Does this tag work in app.config in standard forms applications too? If yes... where shall it be placed? Or.. is there another way…
thomas nn
  • 933
  • 3
  • 13
  • 21
14
votes
8 answers

How should web sites deal with localization settings? (from “What are common UI misconceptions and annoyances?”)

I’ve chosen to take this as a question in its own right since it was generating so much debate in the comments of the original post. It’s interesting to see that a lot of people on SO (who are developer's) just don't get localization. Here’s my take…
Mark
  • 2,392
  • 4
  • 21
  • 42
13
votes
2 answers

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: [HttpGet] [Route("api/Test/{id1}/{id2}")] public NRBQEntity GetTestMessage(String id1, String id2) { return NRBQClient.GetTestMessage(id1, id2); } Although it does not crash the app, when I reach…
13
votes
4 answers

What cultures are supported by the CultureInfo class in .NET 3.5?

I need a list of cultures that are supported by .NET 3.5, regardless of the OS used. This seems to be quite a struggle to obtain, though I am not sure why! Edit: Arghh, I was not aware that it is dependent on the OS, that would explain the lack of…