internationalization

Empty catalog when internationalizing JavaScript code

核能气质少年 提交于 2019-12-10 02:26:36
问题 I'm trying to set up Internationalization of JavaScript code in my Django application. My Django app has a locale subdirectory with a properly generated djangojs.po file. The package definition is as follows: # urls.py js_info_dict = { 'packages': ('my_project',), } ./manage.py makemessages worked well as the .po file contains all the to-be-translated strings but no JavaScript string ever gets translated on the website and the catalog is always empty. 回答1: I also had some problems with. This

Internationalization of distances in java

元气小坏坏 提交于 2019-12-10 02:22:28
问题 Is it possible in Java without any extra library to internationalize distances? I mean it is possible to handle that with date, time, currencies, numbers... I would have expected to find a NumberFormat.getDistanceInstance or something. Is there something like that already embedded or should i make my own internationalization system for distances (mostly miles vs kilometers) 回答1: I would love to hear about such formatter but unfortunately I never did. The problem is, there is no such data in

Cyrillic alphabet validation

喜你入骨 提交于 2019-12-10 02:21:40
问题 I came across an interesting defect today the issue is I have a deployment of my web application in Russia and the name value "Наталья" is not returning true as alphaNumeric in the method below. Curious for some input on how people would approach a problem like this! - Duncan private boolean isAlphaNumeric(String str) { return str.matches("[\\w-']+"); } 回答1: You have to use Unicode regex . for example \p{L}+ for any unicode letter. For more look in the java doc for java.util.Pattern there is

Set a locale in javascript

折月煮酒 提交于 2019-12-10 01:26:04
问题 jQuery tests the validity of a date via: !/Invalid|NaN/.test(new Date(value)) new Date(dateString) is the same as Date.parse(dateString) and uses browser/OS locale to parse the string. I'm trying to parse DD/MM/YYYY but I get an error because my browser is looking for MM/DD/YYYY . Since my product will be used only by DD/MM people, I want to force this behaviour. I could write a custom validator, but is it possible to change the browser locale via JavaScript as well? 回答1: You can't change the

Indic Language Support for SDK but not PhoneGap

烂漫一生 提交于 2019-12-10 01:04:43
问题 I am trying to develop an app in android with Indian language support exclusively. I just want to convert my text page, on app, in any Indian language, selected by user. For this I don't want to use web-service and also don't want to use Phonegap . I did some research and realise that rendering of Indic fonts are complex. I heard that there is a library "Harfbuzz" that render Indic Fonts properly, but it supports only NDK . Is there any library or engine for SDK ? 回答1: Check out this page of

How to provide i18n service for developer and end user

混江龙づ霸主 提交于 2019-12-10 00:12:55
问题 Many android applications have quite poor i18n-support, and for an understandable reason, as it adds much work for the developer. From a both intuitive and cultural point of view it would be a good thing if end-users could translate the apps themself, and OTA share the translation, without reinstalling the app itself. In concept; as wikipedia, some add content easily, others only use what's there. It's of course important that the service is as easy as possible to use, both for app-developers

django unicode encode/decode errors

。_饼干妹妹 提交于 2019-12-09 23:12:51
问题 My site needs to be able to serve data in different languages. I set it so it uses utf-8 and the db settings are set to that as well. I've been getting different different unicode errors over the admin. For example: In the admin list, when a field from the list contains a non ascii char. (i get UnicodeDecodeError) When adding a new entry, a UnicodeEncodeError if the unicode method for the model returns an utf-8 decode (which fixes #1). When using a filter_horizontal in the admin, if data from

C++ Win32: Converting scan code to Unicode character

半腔热情 提交于 2019-12-09 21:41:49
问题 When I switch to Russian layout in Windows 7 and press ; key on the keyboard, I get Russian letter ж on the screen. I am working on a application where I need to detected pressed keys and draw text on the screen. The requirement is handle all supported languages. This is my code: // I scan the keyboard for pressed keys for (short key = KEY_SCAN_MIN; key <= KEY_SCAN_MAX; ++key) { if (GetAsyncKeyState(key) & 0x8000) { // When I detect a pressed key, I convert the scan code into virtual key. //

Could not load nib in bundle base internationalization

半世苍凉 提交于 2019-12-09 19:41:56
问题 I have a project that I created in xcode 4.5 with a target ios of 5.0 and I used Base Internationalization. Base Internationalization moves the nib files to Base.lproj. The project runs on my iPhone 4 running ios 6 and on my iPad 3 running ios 6. But this error shows when I try to run it on my iPad 1 running ios 5.1.1. In the Build Phase section of the target, the nib files are shown in red. When I try to add the nib files to the Build Phases bundle resources, they add but they are still red

How to do I18N with xsl and xml

雨燕双飞 提交于 2019-12-09 18:15:13
问题 I am trying to do a page in different languages with xml/xsl. I want to have only one xml and one xsl. On my page Url I have a parameter pLanguage that I think I can use to look if I have selected English or Dutch. I tried with this code but I don’t know how I put it together: First I make variables of all the words who has to been translated like this: <xsl:variable name="lang.pageTitle" select="'This is the title in English'"/> To get the pageTitle in the template I now can use <xsl:value