internationalization

atoi() with other languages

寵の児 提交于 2019-12-23 09:37:40
问题 I am working on a internationalization project. Do other languages, such as Arabic or Chinese, use different representations for digits besides 0-9? If so, are there versions of atoi() that will account for these other representations? I should add that I am mainly concerned with parsing input from the user. If the users types in some other representation I want to be sure that I recognize it as a number and treat it accordingly. 回答1: I may use std::wistringstream and locale to generate this

Different facelets (for use in templates) in JSF 2 per locale

社会主义新天地 提交于 2019-12-23 09:34:50
问题 I have a template somewhere that has <ui:insert name="help_contents" /> and a page that defines <ui:define name="help_contents><!-- actual contents --></ui:define> , where the contents in the definition should be JSF-based (not just plain html/xhtml), handled by the faces servlet and differing based on locale. But I don't want to do this with resource bundles, since that would require large swathes of text per property and having to break it up for every component that's interspersed with the

Why does Javascript string replace reverse the word order for right to left languages?

佐手、 提交于 2019-12-23 09:26:35
问题 I'm curious as to why the following placeholder replacement for a right to left language (these are random Arabic characters) causes the formatted string to reverse all the words. '{0} تكنولوجيا'.replace('{0}', 'هلهل') => "هلهل تكنولوجيا" This behavior was observed in the latest Chrome, FF, and Safari. It keeps the word order the same in Node. 回答1: It doesn't. replace does exactly what you asked it to do: Replaces the first three letters of that string with هلهل ; I'm going to make it four

ASP.NET (MVC) routes internationalization

廉价感情. 提交于 2019-12-23 09:19:59
问题 I was looking for a solution to internationalize/localize routes on an ASP.NET MVC website. I stumbled upon the blog post Translating routes (ASP.NET MVC and Webforms) by Maarten Balliauw. He present a very nice solution, which works great - until there's a Html.RenderAction("...") in the view. Basically he introduces a TranslatedRoute inheriting from System.Web.Routing.Route , that than does the translation using a Dictionary with the translations on the fly. Any idea why this behaves

Is it appropriate to use non-ASCII (natural-language) XML tags?

谁说我不能喝 提交于 2019-12-23 08:39:14
问题 Is it appropriate to use XML tags (element names) written in non-ASCII natural languages? The XML spec allows it (see Names and Exceptions), but I couldn't find any best practices about this at W3C and related pages. What I'm looking for is practical advice regarding which tools support this, whether important XML-related technologies such as XSLT and XForms may have problems with it, etc. I think Andrey and Tomalak are missing the point. XML is not necessarily read by programmers, it is read

How to format numbers and dates based on user locale settings?

微笑、不失礼 提交于 2019-12-23 08:09:08
问题 I need a way to automatically format Date and Number objects based on locale settings of my users. So far, I've been using toLocaleString() function for dates. For numbers, toLocaleString() is also available, but as you can see in the jsFiddle I've prepared, results vary greatly between browsers. With English (United States) locale on my Windows machine, I get this: IE9: 15,000.00 Firefox: 15,000 Chrome: 15000 In Chrome, it seems like toLocaleString() does not work at all for numbers. Except

How to format numbers and dates based on user locale settings?

北慕城南 提交于 2019-12-23 08:09:03
问题 I need a way to automatically format Date and Number objects based on locale settings of my users. So far, I've been using toLocaleString() function for dates. For numbers, toLocaleString() is also available, but as you can see in the jsFiddle I've prepared, results vary greatly between browsers. With English (United States) locale on my Windows machine, I get this: IE9: 15,000.00 Firefox: 15,000 Chrome: 15000 In Chrome, it seems like toLocaleString() does not work at all for numbers. Except

Combining keys and full text when working with gettext and .po files

ε祈祈猫儿з 提交于 2019-12-23 07:46:31
问题 I am looking at gettext and .po files for creating a multilingual application. My understanding is that in the .po file msgid is the source and msgstr is the translation. Accordingly I see 2 ways of defining msgid : Using full text (e.g. "My name is %s.\n" ) with the following advantages: when calling gettext you can clearly see what is about to be translated it's easier to translate .po files because they contain the actual content to be translated Using a key (e.g. my-name %s ) with the

Collation STRENGTH and local language relation

时光怂恿深爱的人放手 提交于 2019-12-23 07:28:25
问题 I have read the following from Collator's Javadoc. "The exact assignment of strengths to language features is locale dependant. For example, in Czech, "e" and "f" are considered primary differences, while "e" and "ê" are secondary differences, "e" and "E" are tertiary differences and "e" and "e" are identical." Does this mean that I should set the STRENGTH based on the language I am using? If so can someone suggest the defaults for the locales: us_en, us_es, ca_fr, spain_spanish, chile

How to override the django admin translation?

荒凉一梦 提交于 2019-12-23 07:17:08
问题 I'm trying to override the default translations of Django's admin site. I'm using Django 1.6. My settings.py contains: import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # ... LANGUAGE_CODE = 'nl' USE_I18N = True USE_L10N = True LOCALE_PATHS = (os.path.join(BASE_DIR, "locale"),) I have copied the file django/contrib/admin/locale/nl/LC_MESSAGES/django.po to my_project/locale/nl/LC_MESSAGES/django.po and I've made some changes to it. Next, I have run python manage.py