globalization

Validating Locale-Specific “Customary” Date Formats

有些话、适合烂在心里 提交于 2020-01-17 03:59:18
问题 If I run this code... var cults = CultureInfo.GetCultures(CultureTypes.SpecificCultures); var exam = from c in cults from p in c.DateTimeFormat.GetAllDateTimePatterns('d') select new { Culture = c.DisplayName, Format = p }; ...I can see a dump of the various "short date" formats that Windows or .net thinks is customary or standard for different locales. But how would anyone independently confirm or verify these values? I recognize that Microsoft has invested possibly many 10's of thousands of

How to determine nationality based on IP address?

删除回忆录丶 提交于 2020-01-16 19:32:13
问题 How can I tell the nationality of a user of my web site based on client ip? Edit: Like commented, this question have been answered before: https://stackoverflow.com/questions/283016/know-a-good-ip-address-geolocation-service 回答1: use the GeoIP databse. there is a free one. there are also a lot of GeoIP webServices you can use. 回答2: If you're thinking localization, let the user choose the correct language instead of doing it automatically -- or at least provide an easy way for them to change

DateTime supported language for formatting?

杀马特。学长 韩版系。学妹 提交于 2020-01-14 01:56:38
问题 DateTime let you format depending of the current culture. What are the culture supported by default? The scenario I have in mind use this.Date.Value.ToString("MMMM") which will print "January" if the culture is set to english-us but will print "Janvier" if the culture is in french-ca. This formatting documentation can be found at MSDN website but doesn't give the scope of culture this one can translate. I would like to know what languages are supported and if a language is not, what are my

DateTime supported language for formatting?

五迷三道 提交于 2020-01-14 01:56:08
问题 DateTime let you format depending of the current culture. What are the culture supported by default? The scenario I have in mind use this.Date.Value.ToString("MMMM") which will print "January" if the culture is set to english-us but will print "Janvier" if the culture is in french-ca. This formatting documentation can be found at MSDN website but doesn't give the scope of culture this one can translate. I would like to know what languages are supported and if a language is not, what are my

validating date format not working

☆樱花仙子☆ 提交于 2020-01-13 11:26:26
问题 I'm having problem with date validation. In my View, I have a jQuery datepicker - I changed the format from yy/mm/dd to mm/dd/yy and now I get client-side validation errors. For example, The value '02/25/2014' is not valid for Date of Birth. The Javascript: $('#DateOfBirth').datepicker({ changeMonth: true, changeYear: true, dateFormat: "mm/dd/yy", yearRange: "-90:-5" }); The View Model: [Required] [Display(Name = "Date of Birth")] public DateTime? DateOfBirth { get; set; } The View: @Html

Installing more cultures on Windows Server 2012

江枫思渺然 提交于 2020-01-13 03:37:08
问题 On a Windows 8.1 machine, I'm seeing many more available cultures than on a Windows Server 2012 machine: 791 vs 378. To give a specific example, the server machine is missing the 'en-HK' culture. Here is the test code I'm using to enumerate them: foreach (var ci in CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures).OrderBy(ci => ci.Name)) { Console.WriteLine("{0} ({1})", ci.Name, ci.EnglishName); } Question: how can I install the more complete culture list on Windows

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

霸气de小男生 提交于 2020-01-12 12:54:08
问题 In trying to localize my application, I've followed the steps here: https://docs.asp.net/en/latest/fundamentals/localization.html Here is my code: Startup.cs public List<IRequestCultureProvider> RequestCultureProviders { get; private set; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddLocalization(options => options.ResourcesPath = "Resources"); services.AddMvc()

How to globalize ASP.NET MVC views (decimal separators in particular)?

穿精又带淫゛_ 提交于 2020-01-10 04:05:07
问题 I'm working with the NerdDinner sample application and arrived at the section which deals with the Virtual Earth map. The application stores some values for the longitude and latitude. Unfortunately on my system floating point numbers are stored with a comma as the decimal separator, not a dot like in the US. So if I have a latitude of 47.64 it's retrieved and displayed as 47,64. Because that value is passed in a function call to the Virtual Earth API it fails at that point (e.g. JavaScript

Setting up Culture to Aspx website

坚强是说给别人听的谎言 提交于 2020-01-05 10:33:17
问题 I have website that has some issue to work with. One of the issues is loading 5x. I have been trying to set language speficic for the page. My problem is as follows: While page is refreshing n times it does somewhere overrides page language settings. I had as test modified global.asax page in Application_Start method. This method gets called only once. After this page goes into default.aspx page and hits the page ntimes, when the page gets initialised it change culture to default culture en

Setting up Culture to Aspx website

时光毁灭记忆、已成空白 提交于 2020-01-05 10:33:08
问题 I have website that has some issue to work with. One of the issues is loading 5x. I have been trying to set language speficic for the page. My problem is as follows: While page is refreshing n times it does somewhere overrides page language settings. I had as test modified global.asax page in Application_Start method. This method gets called only once. After this page goes into default.aspx page and hits the page ntimes, when the page gets initialised it change culture to default culture en