globalization

.resx vs database vs custom solution for providing Localization/Globalization

北城余情 提交于 2019-11-28 19:09:42
At my office, we have had a long-standing debate about Localization/Globalization and how to handle it. One side pushes for the Resource (.resx) file route built in to ASP.NET, one side pushes for a database driven solution. A third group believes in rolling a custom solution. Of course, each method has its own unique benefits and disadvantages - and we've discussed it over and over, without ever coming to a real consensus. So, I pose it to the community: in your experience, which method provides the best mix of the following as the application grows: Maintainability Extensibility Performance

ASP.NET - MVC 3: Localization

只谈情不闲聊 提交于 2019-11-28 16:41:16
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 would be like using the Viewbag. Then edit the Global.asax to handle culture changing and create a

Globalization in ASP.Net MVC 3

浪尽此生 提交于 2019-11-28 16:00:17
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. Martin Booth 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 PublicResXFileCodeGenerator Populate the Resource file with Translation key and value pairs (this will be the

From where CultureInfo.CurrentCulture reads culture

前提是你 提交于 2019-11-28 13:34:13
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 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.CurrentCulture property. When a thread is started, its culture is initially determined by calling the Windows

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

帅比萌擦擦* 提交于 2019-11-28 13:21:50
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 documentation. Any ideas on what is supported by Mac/Linux OS as well? Thanks :) Unfortunately, it is OS dependent. Check here for default language support per OS. Note, the CultureInfo documentation warns: Windows versions or service packs can change the available cultures. In ASP.NET, it's the browser that's important versus the OS. It can tell you

Globalization in MVCSiteMapProvider

亡梦爱人 提交于 2019-11-28 13:08:32
Hi have a sitemap on my mvc 4 application like this: <?xml version="1.0" encoding="utf-8" ?> <mvcSiteMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0" xsi:schemaLocation="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0 MvcSiteMapSchema.xsd"> <mvcSiteMapNode title="Users" controller="User" action="Index" area="" preservedRouteParameters="culture,projectid"> <mvcSiteMapNode title="New" controller="User" action="Create" area="" preservedRouteParameters="culture,projectid"/> <mvcSiteMapNode title="Edit"

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

不羁岁月 提交于 2019-11-28 12:54:51
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" /> </system.web> stepped through the jQuery code - the globalization there seems to work. i'm using a get

jQuery date validation MVC 4 .Net 4.5.1 UK date “must be a date” Error

≡放荡痞女 提交于 2019-11-28 12:19:10
I have an app that I have recently upgraded to .Net 4.5.1 and MVC 4. I am using the jQuery datepicker and jQuery.validation 1.11.1. I am in the UK therefore the dates will be in the en-GB locale ("dd/mm/yyyy"). I have tried what is suggested here , here and here but to no avail. I also have in my web.config: <globalization uiCulture="en-GB" culture="en-GB" /> and have set the globalisation in IIS to en-GB, but every date that is input is validated as a US format date. Can anyone help please? Changing the date validation method in jQuery.validate.js to the follwing solved the issue: date:

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

你。 提交于 2019-11-28 11:19:36
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, provider, DateTimeStyles.None, out result); Assert.IsTrue(b); Assert.AreEqual(expected, result);

Decimal to string with thousand's separators?

天大地大妈咪最大 提交于 2019-11-28 07:44:29
问题 Consider a Decimal value: Decimal value = -1234567890.1234789012M; i want to convert this Decimal value to a string, and include "thousands separators" . Note: i don't want to include thousand's separators , i want to include digit grouping . The difference is important for cultures that don't group numbers into thousands, or don't use commas to separate groups Some example output with different standard formatting strings, on my computer, with my current locale: value.ToString() =