globalization

How to utilize globalization in JavaScript?

China☆狼群 提交于 2020-01-05 04:00:07
问题 I have created 3 resx files in App_GlobalResources folder in asp.net project in order to make a multilingual website, as you know it's sort of key-value set, everything seems good else cases in which I want to use values in JavaScript. If I use inline JavaScript in aspx file it can be done using this way or alert('<%= GetGlobalResourceObject([ResourceClassName],[ResourceKey]) %>'); Or <asp:Literal runat="server" Text="<%$ Resources:[ResourceClassName], [ResourceKey] %>"/> but how should I

Convert CSV file or Excel spreadsheet to RESX File

旧巷老猫 提交于 2020-01-03 15:33:29
问题 I am looking for a solution or recommendation to a problem I am having. I have a bunch of ASPX pages that will be localized and have a bunch of text that needs to be supported in 6 languages. The people doing the translation will not have access to Visual Studio and the likely easiest tool is Excel. If we use Excel or even export to CSV, we need to be able to import to move to .resx files. So, what is the best method for this? I am aware of this question, Convert a Visual Studio resource file

Best way for multi-language sites virtual Directories

吃可爱长大的小学妹 提交于 2020-01-03 02:39:10
问题 I have a site that will ultimately support 4 languages and 2 countries (US & Canada, English and Spanish) I'm wondering what's the best way to set up the directory structure? Right now, I have a root site called site.com: This will take you to a page where you choose your country and language. Ideally, I want to have the directory like so: site.com/ca/en/ (Canada English) site.com/ca/fr/ (Canada French) site.com/us/en/ (US English) site.com/us/es/ (US Spanish) But that will mean I will be

Add second language support with root path in an existing ASP.NET WebForms site

自古美人都是妖i 提交于 2020-01-01 16:37:26
问题 I have inherited from a very small ASP.NET WebForms project, and my customer would like to add a second language to it. For every "somepage.aspx", I'd like to support a "second language path" version of it, like "fr/somepage.aspx". I'd like to handle this using normal globalization (CurrentCulture + resource files in both languages) and avoid having to duplicate each page. I must keep the original paths valid, thus I have excluded ASP.NET MVC for now (for lack of knowing if I could continue

Units of distance for the current CultureInfo in .Net

℡╲_俬逩灬. 提交于 2020-01-01 08:24:05
问题 Is it possible to get the unit of distance from a CultureInfo class or any other class in the System.Globalization namespace. e.g. "en-GB" would be "mile", "en-FR" would be "km" 回答1: RegionInfo.CurrentRegion.IsMetric 来源: https://stackoverflow.com/questions/6020359/units-of-distance-for-the-current-cultureinfo-in-net

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

自作多情 提交于 2020-01-01 04:11:11
问题 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

How to get the country code from CultureInfo?

六眼飞鱼酱① 提交于 2020-01-01 03:59:53
问题 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? 回答1: var c = new CultureInfo("en-GB"); var r = new

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

百般思念 提交于 2020-01-01 02:06:13
问题 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") 回答1: Try this, @Resources.General.Hello syntax: Resources.[ResourceName].[Property]

Terminology used for language and culture-aware software

强颜欢笑 提交于 2019-12-30 08:23:23
问题 I have always thought that the terms "internationalization" and "localization" (and their funny abbreviations i18n and l10n) were universally accepted and used for talking about software which is aware of language and cultural differences. But I recently read a question on SO about these subjects which referred to something called "globalization" and was also tagged as such. Because I haven't heard this term before I wanted to know if is actually used by others and how it compares to the

DataAnnotations and Resources don't play nicely

﹥>﹥吖頭↗ 提交于 2019-12-29 06:49:13
问题 I'm using dataannotations in an MVC2 app and am a little discouraged when trying to use RESX file resources for error messages. I've tried the following but keep getting the exception "An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type" [Required(ErrorMessage = Resources.ErrorMessages.Required)] [Required(ErrorMessageResourceName = Resources.ErrorMessages.Required, ErrorMessageResourceType = typeof(Resources