globalization

Why is ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ the native name of the U.S.?

随声附和 提交于 2019-12-03 09:52:19
When I use this code: var ri = new RegionInfo("us"); var nativeName = ri.NativeName; // ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ why is nativeName then the string "ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ" (in Cherokee )? If I change to new RegionInfo("US") (only difference, capital US ), I get instead "United States" . I do know the preferred usage of RegionInfo is to give a specific culture info string such as: new RegionInfo("en-US") new RegionInfo("chr-Cher-US") and so on, and that works. But why is Cherokee preferred over English only if I use lower-case us ? (Seen on Windows 10 (version 1803 "April 2018 Update"), .NET Framework 4.7.2.)

How to get the country code from CultureInfo?

故事扮演 提交于 2019-12-03 09:51:37
I have the following: System.Globalization.CultureInfo c = new System.Globalization.CultureInfo("en-GB"); var a = c.DisplayName; var b = c.EnglishName; var d = c.LCID; var e = c.Name; var f = c.NativeName; var g = c.TextInfo; var h = c.ThreeLetterISOLanguageName; var i = c.ThreeLetterWindowsLanguageName; var j = c.TwoLetterISOLanguageName; None of this gives me the country code, e.g. GB . Is there a way to get it without string splitting? var c = new CultureInfo("en-GB"); var r = new RegionInfo(c.LCID); string name = r.Name; Most probably you need to use r.TwoLetterISORegionName property.

How to specify CodeAnalysisRules in MSBuild via commandline

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to be able to specify the Code AnalysisRules in commandline MSBuild (for Code Analysis / FXCOP). The project file would have something like this in it: <CodeAnalysisRules>-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302</CodeAnalysisRules> So I would assume that I use something like this: MSBuild.exe /property:RunCodeAnalysis=true /property:CodeAnalysisRules=-Microsoft.Globalization#CA1301 Which works fine, but when I want to add another rule, it does not like the semi colon: MSBuild.exe /property:RunCodeAnalysis=true

.NET Globalization & Satellite DLL's

情到浓时终转凉″ 提交于 2019-12-03 07:42:23
I'm working on localizing an app I've written in C#. Everything seems to be working nicely, using satellite resource assemblies to translate each form's strings (as per this tutorial: http://msdn.microsoft.com/en-us/library/y99d1cd3%28VS.71%29.aspx ) However, the application will ultimately require quite a number of languages, which means loads of directories in my working directory (i.e. /zh-tw, /zh-cn, /fr-FR, /ja-JP, etc). I'd like to clean this up a bit by locating all of them within a /languages or /resources subdirectory (in other words, set the "base path for satellite assemblies"). But

.NET RegionInfo class

懵懂的女人 提交于 2019-12-03 07:04:54
When I try to create a new RegionInfo with certain ISO 3166 country codes ("BD" for Bangladesh, "SO" for Somalia, "LK" for Sri Lanka), I get an ArgumentException that says it's not recognized. What's the deal? The Intellisense of RegionInfo(string) says it conforms to ISO 3166, but these country/region codes are not supported? I don't get it. .NET doesn't provide all Cultures/Regions out-of-the-box. Note the 'predefined' RegionInfos here: http://msdn.microsoft.com/en-us/library/system.globalization.regioninfo(VS.80).aspx . Unfortunately, if you want to use non-predefined Regions, you have to

Android change and set default locale within the app

大憨熊 提交于 2019-12-03 06:55:21
问题 I am working on globalization of Android app. I have to provide options to choose different locales from within the app. I am using the following code in my activity (HomeActivity) where I provide option to change the locale Configuration config = new Configuration(); config.locale = selectedLocale; // set accordingly // eg. if Hindi then selectedLocale = new Locale("hi"); Locale.setDefault(selectedLocale); // has no effect Resources res = getApplicationContext().getResources(); res

Using a CSS File for site localization

◇◆丶佛笑我妖孽 提交于 2019-12-03 06:48:17
I'm creating a website with ASP.net MVC 2.0 which uses two different languages (English and Persian). I want to have two different layouts for these languages, English has a left to right and Persian has a right to left layout. What came to my mind was, if I could have two different css files, like when you do it with string or image localization will do the work for the site, the problem is I need to know how to do this! Any other suggestions on how to perform this would be helpful. You can read about: (W3C) Internationalization Best Practices: Specifying Language in XHTML & HTML Content ,

Implementing internationalization (language strings) in a PHP application

给你一囗甜甜゛ 提交于 2019-12-03 06:40:23
问题 I want to build a CMS that can handle fetching locale strings to support internationalization. I plan on storing the strings in a database, and then placing a key/value cache like memcache in between the database and the application to prevent performance drops for hitting the database each page for a translation. This is more complex than using PHP files with arrays of strings - but that method is incredibly inefficient when you have 2,000 translation lines. I thought about using gettext,

How to access global resources in a view using asp.net mvc razor

我们两清 提交于 2019-12-03 04:52:26
Using ASP.NET MVC Razor, I have a resource file in App_GlobalResources named General.resx and General.fr.resx with a name value pairings of "Hello" and "Hello" and "Hello" and "Bonjour". How do I reference these from my view? These do not work: @Html.Resource("General.Hello") @Html.Resource("GlobalResources.Hello") @Html.Resource("GlobalResources.General.Hello") @Html.Resource("GlobalResources, General.Hello") Try this, @Resources.General.Hello syntax: Resources.[ResourceName].[Property] you need to refer to your namespace: @GeneralResxNamespace.General.Hello You can do this in an easier way

ASP.NET MVC: When to set Thread.CurrentThread.CurrentUICulture?

喜欢而已 提交于 2019-12-03 03:38:16
问题 I am just beginning to localize an ASP.NET MVC application. Most of the strings will be defined in resource files and retrieved via Matt's Localization Helpers. Other strings must be stored in a database. My Question: Should I set CurrentUICulture early in the request pipeline and use that throughout the application, or directly use Request.UserLanguages[0] whenever needed? Right now I'm thinking that I should set CurrentUICulture in Application_BeginRequest . The implementation would look