globalization

Handling timezones in storage?

孤人 提交于 2019-11-27 19:25:28
Store everything in GMT? Store everything the way it was entered with an embedded offset? Do the math everytime you render? Display relative Times "1 minutes ago"? You have to store in UTC - if you don't, your historic reporting and behaviour during things like Daylight Savings goes... funny. GMT is a local time, subject to Daylight Savings relative to UTC (which is not). Presentation to users in different time-zones can be a real bastard if you're storing local time. It's easy to adjust to local if your raw data is in UTC - just add your user's offset and you're done! Joel talked about this

Converting country codes in .NET

泪湿孤枕 提交于 2019-11-27 18:58:33
In .NET is there any way to convert from three letter country codes (defined in ISO 3166-1 alpha-3) to two letter language codes (defined in ISO 3166-1 alpha-2) eg. convert BEL to BE? Have looked at the RegionInfo class in System.Globalization but the constructor does not seem to support the three letter codes. Mormegil The RegionInfo class does know the three-letter code (in the ThreeLetterISORegionName property), but I don’t think there is a way to get RegionInfo based on this code, you would need to enumerate all regions and add them to your own dictionary, with the three-letter code as a

How to change UIPageViewController direction of paging curl animation

一世执手 提交于 2019-11-27 18:46:41
问题 I need to display Arabic (Right To Left) content and couldn't find any method to rotate animation of the page curl found by UIPageViewController because basically Arabic books should be turned from Left to right. 回答1: If you are supporting only portrait mode then you should look at the UIPageViewController delegate method pageViewController:spineLocationForInterfaceOrientation: and return UIPageViewControllerSpineLocationMax . But if you want to support both landscape and portrait then you

What is the “best” way to store international addresses in a database?

允我心安 提交于 2019-11-27 18:43:46
What is the " best " way to store international addresses in a database? Answer in the form of a schema and an explanation of the reasons why you chose to normalize (or not) the way you did. Also explain why you chose the type and length of each field. Note: You decide what fields you think are necessary. Plain freeform text. Validating all the world's post/zip codes is too hard; a fixed list of countries is too politically sensitive; mandatory state/region/other administrative subdivision is just plain inappropriate (all too often I'm asked which county I live in--when I don't, because

Multilanguage in WPF [closed]

帅比萌擦擦* 提交于 2019-11-27 17:28:05
Can you recommend a good way to implement a Multilanguage system for a WPF app? The method I'm using right now involves XML, classes and a xaml extension. It Works fine in most of cases, but when I have to deal with dynamic labels or dynamic text in general it require some extra effort. I would like to let the programmer working only in the main problem and forgot the lang issues. CSharper I am using the WPF Localization Extension . It is a really easy way to localize any type of DependencyProperty on DependencyObject s. is in a real stable state supports binding-like writing style like Text =

Difference between CurrentCulture, InvariantCulture, CurrentUICulture and InstalledUICulture

会有一股神秘感。 提交于 2019-11-27 17:04:58
What is the difference between CurrentCulture , InvariantCulture , CurrentUICulture and InstalledUICulture from System.Globalization.CultureInfo ? Paweł Dyda I would try to give a bit more insightful answer than this one . CurrentCulture should be used for formatting. That is, Numbers, Currencies, Percentages, Dates and Times should always be formatted with this culture before displaying them to user . Few examples here: const string CURRENCY_FORMAT = "c"; const string PERCENTAGE_FORMAT = "p"; DateTime now = DateTime.UtcNow; // all dates should be kept in UTC internally // convert time to

Make URL language-specific (via routes)

六月ゝ 毕业季﹏ 提交于 2019-11-27 13:12:19
问题 Its hard to find an answer to this specific question, so ill pop it up here: We want to build up our urls completely language specific, meaning www.mysite.com/EN www.mysite.com/DE this is done in the RouteConfig with url: "{language}/{controller}/{action}/{id}" But then the tricky part: www.mysite.com/EN/Categories www.mysite.com/DE/Kategorien I.e. make the controllername appear in a multiple languages, but point to the same controller. Is this even possible? 回答1: Well, this is partially

.NET: Are there any differences between InvariantCulture and en-US?

与世无争的帅哥 提交于 2019-11-27 13:09:29
Given the following two cultures: CultureInfo c1 = InvariantCulture; CultureInfo c2 = new CultureInfo("en-US"); and i were to examine every piece of information specific to both cultures, e.g.: c1.DateTimeInfo.ShortDatePattern; c2.DateTimeInfo.ShortDatePattern; c1.DateTimeInfo.LongDatePattern; c2.DateTimeInfo.LongDatePattern; c1.NumberFormat.CurrencyDecimalDigits; c2.NumberFormat.CurrencyDecimalDigits; c1.TextInfo.IsRightToLeft; c2.TextInfo.IsRightToLeft; Would i find any differences? In other words, is the InvariantCulture, for all purposes, identical to the "en-US" culture? David Morton Yes.

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

痴心易碎 提交于 2019-11-27 12:44:50
问题 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

What is the best way to handle validation with different culture

本秂侑毒 提交于 2019-11-27 12:16:11
问题 I am trying to build a multilingual MVC application. I have a form in my application and I have field to enter a cost. I am able to create a record using the spanish culture. But on trying to update the record I am getting jquery validation false. and I am getting a default error message as: The field must be numeric. In my view model I have set the following attributes. [LocalizedDisplayName("Label_Cost")] [RegularExpression("^[^<>,<|>]+$", ErrorMessage = null, ErrorMessageResourceName =