internationalization

Is this a good solution for localisation of pluggable components?

纵然是瞬间 提交于 2019-12-07 08:07:45
问题 I asked a question previously which had only a single answer. I've had some time to play around with this now and have a plan, but want some feedback on if it is a good idea. The problem: I want a component which has a name (invariant, used to identify the component) to have its name localised in the application that is consuming it, without polluting the model of the component with a DisplayName attribute. The component may exist in a separate dll and be dynamically loaded at runtime. my

PHP Spoofchecker class

跟風遠走 提交于 2019-12-07 07:31:15
问题 I'm reading through the PHP manual and came across the Spoofchecker class in the intl extension documentation pages. The methods in the class, their parameters, as well as the class itself are all fairly undocumented as of right now so I'm wondering what the purpose of it is. 回答1: The class is calling ICU' library so you may find more detail. There they say, Because Unicode contains such a large number of characters and incorporates the varied writing systems of the world, incorrect usage can

Converting UTF8 text for use in a URL

半腔热情 提交于 2019-12-07 07:27:10
问题 I'm developing an international site which uses UTF8 to display non english characters. I'm also using friendly URLS which contain the item name. Obviously I can't use the non english characters in the URL. Is there some sort of common practice for this conversion? I'm not sure which english characters i should be replacing them with. Some are quite obvious (like è to e) but other characters I am not familiar with (such as ß). 回答1: I normally use iconv() with the 'ASCII//TRANSLIT' option.

UITextInputMode currentInputMode is deprecated. Suggested replacement?

你离开我真会死。 提交于 2019-12-07 07:03:13
问题 In our app, we'd like to detect the current keyboard language. For example, if the user sets up multiple language keyboards under Settings->General->Keyboard->Keyboards, we'd like to know what language they're typing in and to get a notification from NSNotificationCenter when this changes. - (void)viewDidLoad { [super viewDidLoad]; NSNotificationCenter *nCenter = [NSNotificationCenter defaultCenter]; [nCenter addObserver:self selector:@selector(languageChanged:) name

List Rails I18n strings with full keys

拟墨画扇 提交于 2019-12-07 06:13:17
问题 I'd like to be able to generate a complete list of all the I18n keys and values for a locale including the full keys. In other words if I have these files: config/locales/en.yml en: greeting: polite: "Good evening" informal: "What's up?" config/locales/second.en.yml en: farewell: polite: "Goodbye" informal: "Later" I want the following output: greeting.polite: "Good evening" greeting.informal: "What's up?" farewell.polite: "Goodbye" farewell.informal: "Later" How do I do this? 回答1: Nick

replace english quotes to german quotes

梦想与她 提交于 2019-12-07 06:08:54
问题 is there a way to implement german quotes (so-called 'Gänsefüßchen') „ („) and “ (“) in a function to convert english-quoted strings like I say "Hallo" to I say „Hallo“ the &bdquo should only apply at the beginning, the &ldquo at the end of an string. 回答1: Here is the function, tested and works fine. Note: the &bdquo applies only at the beginning, the &rdquo only at the end of an string. (hsz's solution isn't following that rule) function germanquotes($text){ $size = strlen($text); $i=0;

MySQL Database Design with Internationalization

时间秒杀一切 提交于 2019-12-07 06:07:14
问题 I'm going to start work on a medium sized application, and i'm planning it's db design. One thing that I'm not sure about is this. I will have many tables which will need internationalization, such as: "membership_options, gender_options, language_options etc" Each of these tables will share common i18n fields, like: "title, alternative_title, short_description, description" In your opinion which is the best way to do it? Have an i18n table with the same fields for each of the tables that

Is there a way to get the decimal and thousands separator in ECMAscript Internationalization API?

痞子三分冷 提交于 2019-12-07 06:04:47
问题 I'm trying to use the new Javascript internationalization API, and would like to know if there is a way to get the decimal and thousands (grouping) separator for a Intl.NumberFormat instance? There is a resolvedOptions method on the object, but that does not provide the symbols. In case anybody's wondering, then for en-US, these would be a comma , and period . , such as in 1,000.00 . 回答1: I'm afraid ECMA-402 standard does not define the API that let you access separators. There is also

Good way to provide Rails-way i18n support in Django

坚强是说给别人听的谎言 提交于 2019-12-07 05:59:52
问题 There's one thing in (new) Rails I envy: internationalization support (Django has one too, but I prefer Rails' flavour). The key difference between Rails' and Django's approaches is what kind of string behaves like keys in key-value translation mapping, i.e. Django version (keys - strings in "main" language, for example english): msgid "Save and quit" msgstr "Zapisz i wyjdź" Rails version equivalent (keys - abstract strings; standalone unusable - one need to provide at least 1 "translation")

Django makemessages not working for JS files

穿精又带淫゛_ 提交于 2019-12-07 05:52:19
问题 My setup settings.py INSTALLED_APPS = ( ... 'myprojectname', ... ) STATIC_ROOT = '/var/www/a_valid_path/' LOCALE_PATHS = ( os.path.join(BASE_DIR, "locale"), ) urls.py js_info_dict = { 'domain': 'djangojs', 'packages': ('myprojectname',), } urlpatterns = patterns('', ... url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), ... ) My project structure is as follows: |- projectname |--- app1 |--- app2 |--- manage.py |- virtualenv |- static |--- js |--- css I also have the