globalization

Xamarin XAML x:Static reference to property in a nested class

限于喜欢 提交于 2021-01-28 14:22:55
问题 I'm writing a mobile app using Xamarin and I have a static class called Strings that wraps my RESX resources. I want to use x:Static to bind to these in my XAML files. This is working if I have a single static class with static properties to bind to. I'm cutting out some comments and other non-essential bits, but it basically looks like this: namespace MyCompany.Resources { public static partial class Strings { public static string LabelUsername { get { return Resources.LabelUsername; } } } }

How To Convert A Foreign Month In A Date String Into English

强颜欢笑 提交于 2021-01-28 07:32:42
问题 The below answer to another thread seems to make a start on what I think I need, but I am having difficulties in implementing it. The best library for that purpose would probably be Globalize. It allows you to specify the locale (it is called culture but it is actually the same), the format (built-in or your own) and actually parse string to given date: var dateString = "lunes, 29 de agosto de 2011"; // seems like long date format in Spanish var date = Globalize.parseDate( dateString, "D",

I need to store postal codes in a database. How big should the column be?

我们两清 提交于 2020-05-07 09:46:35
问题 I expect the column to be a VARCHAR2, in my Oracle Database. US Zips are 9. Canadian is 7. I am thinking 32 characters would be reasonable upper limit What am I missing? [EDIT] TIL: 12 is a reasonable answer to the question Thanks to everyone who contributed. 回答1: Skimming through Wikipedia's Postal Codes page, 32 characters should be more than enough. I would say even 16 characters is good. 回答2: As already raised by @neil-mcguigan, wikipedia has a decent page on the topic. Based on that 12

I need to store postal codes in a database. How big should the column be?

老子叫甜甜 提交于 2020-05-07 09:44:40
问题 I expect the column to be a VARCHAR2, in my Oracle Database. US Zips are 9. Canadian is 7. I am thinking 32 characters would be reasonable upper limit What am I missing? [EDIT] TIL: 12 is a reasonable answer to the question Thanks to everyone who contributed. 回答1: Skimming through Wikipedia's Postal Codes page, 32 characters should be more than enough. I would say even 16 characters is good. 回答2: As already raised by @neil-mcguigan, wikipedia has a decent page on the topic. Based on that 12

Invalid CultureInfo no longer throws CultureNotFoundException

大憨熊 提交于 2020-04-10 07:14:28
问题 Creating a culture info with es-CA , which obviously is incorrect should throw an exception, but no longer does. This previously threw a CultureNotFoundException : new CultureInfo("es-CA") . It now seem to fall back to es with an "Unknown Locale". Although, doing something like xy-ZZ also works, which it's rather odd? Why does this no longer throw an exception? Was this changed in a recent version of .NET? Update 1 The documentation mentions the following: if the operating system does not

Localization/Globalization in ASP.Net 2.0

爷,独闯天下 提交于 2020-03-25 05:11:24
There are many tutorials that explain you about localization/globalization concept. In this article I just tryed to explain every single point from the developer/programmer point of view. Let me brief you about Resource files. "aspx.resx" (resource)files: Resource files are xml files, which stores string, file paths (image), which are required to translate in to other languages. "App_GlobalResources": You can keep files, which need to be accessed throughout the application. So in our application I have kept "TextDirect" & "EmailFormat" which required to access in maximum pages. In short common

How to set globalization?

蹲街弑〆低调 提交于 2020-03-21 06:58:29
问题 I'm stuck in an ASP.NET Web API Globalization problem. I want to get date time in culture specific format when I invoke a Web API. Please provide some insights. In my solution, first, there is one delegating handler, whose job is to set the culture. It is defined as follows: using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using System.Web; namespace CultureHandling.Handlers { public class

How to honor/inherit user's language settings in WinForm app?

孤街醉人 提交于 2020-02-04 05:41:44
问题 I have worked with globalization settings in the past but not within the .NET environment, which is the topic of this question. What I am seeing is most certainly due to knowledge I have yet to learn so I would appreciate illumination on the following. Setup: My default language setting is English (en-us specifically). I added a second language (Danish) on my development system (WinXP) and then opened the language bar so I could select either at will. I selected Danish on the language bar

Why does this regex return true?

谁说胖子不能爱 提交于 2020-01-24 10:06:51
问题 Why does this regex return true? Regex.IsMatch("العسكرية", "العسكري") I googled and nothing came up. 回答1: I suspect what you posted is actually reversed, where the shorter text is in fact the pattern, and the longer input is the input being matched against. In that case, this would return true since the pattern matches everything but the last letter in the word. To clarify, العسكري is the pattern, and العسكرية is the input. Since I know Arabic I can tell you that the latter would indeed be a

Why does this regex return true?

戏子无情 提交于 2020-01-24 10:06:20
问题 Why does this regex return true? Regex.IsMatch("العسكرية", "العسكري") I googled and nothing came up. 回答1: I suspect what you posted is actually reversed, where the shorter text is in fact the pattern, and the longer input is the input being matched against. In that case, this would return true since the pattern matches everything but the last letter in the word. To clarify, العسكري is the pattern, and العسكرية is the input. Since I know Arabic I can tell you that the latter would indeed be a