internationalization

I18n::InvalidLocale: :en is not a valid locale

萝らか妹 提交于 2019-12-04 23:51:07
I am trying to use I18n.transliterate to "normalize" some text with accented characters so I can analyze and compare it with different languages. However, when using this method the following error pops out I18n::InvalidLocale: :en is not a valid locale from /home/xxx/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n.rb:284:in `enforce_available_locales!' from /home/xxx/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n.rb:235:in `transliterate' from (irb):2 from /home/xxx/.rvm/rubies/ruby-2.1.5/bin/irb:11:in `<main>' I have made some searches for this problem and I only found solutions related to

Same string with different translation

此生再无相见时 提交于 2019-12-04 23:47:26
I have one string that can be translated in varius part of my code in two different way. Now if Use django-admin makemessages -l it I get in django.po this: #: pingapi/ping.py:17 pingapi/nots.py:10 msgid "may" msgstr "maggio" But I would want two different translation: #: pingapi/ping.py:17 msgid "may" msgstr "posso" #: pingapi/nots.py:10 msgid "may" msgstr "maggio" If I run django-admin compilemessage with the translation file posted up, I get: Error: errors happened while running msgmerge error 'duplicate message definition' Any Hints? I'm using Django. You can use gettext's context for that

Layout direction for Arabic is not determined based on the locale (Mac and Linux)

流过昼夜 提交于 2019-12-04 23:41:38
问题 Has anyone managed to have the correct layout direction (left-to-right and right-to-left) be inferred from the user’s language settings? I am having trouble localizing my application to the Arabic (Saudi Arabia) locale. Detection of the current locale, and loading and installing the appropriate QTranslators both work fine. (The text looks great on Linux!) The issue I have is that the global layout direction is not being inferred from the system locale. The documentation for QApplication:

How can using gettext help me here?

我们两清 提交于 2019-12-04 22:29:51
问题 I am trying to set up a way to allow members to translate strings into other languages. You can see an example here: TRANSLATIONS TEST Someone recommended that I use php's native gettext() function for this, instead of what I am already using to load the language files, which is this: function loadLanguageFile($language, $file) { $temp = array(); $data = file_get_contents('./'.$language.'/'.$file.'.'.$language.'.php'); $codes = array ( '/(\'\s*\.\s*\$)(.+?)(\s*\.\s*\')/', '/(=\s*\$)(.+?)(\s*\

Google Maps Android API v2, Marker title/snippet wrong display

爱⌒轻易说出口 提交于 2019-12-04 22:24:29
问题 I use Google Maps Android API v2 with Android to show current position with nearby markers. Nearby places locations and titles are received using Google Places API. The problem is that non-english names at title/snippet are shown in fail way. For the instance, Hebrew names. The sreenshot is attached. ) 回答1: Since Arabic and Hebrew are causing problems, and English and Russian are not, I am going to guess that something is broken in the default info window implementation with respect to right

Where are the AngularJS I18n files?

给你一囗甜甜゛ 提交于 2019-12-04 22:22:45
They talk about locale-specific files here http://docs.angularjs.org/guide/i18n but don't mention where to get them (the official AngularJS repo doesn't contain them). So where does one obtain these locale files? You can also get them with bower : bower install angular-i18n It is the official bower distribution that mirrors the files at https://code.angularjs.org/ More info at https://github.com/angular/bower-angular-i18n tenifre Lastest stable version i18n files at here: http://code.angularjs.org/1.0.3/i18n/ You can also find other versions at here: http://code.angularjs.org/ You can also get

Translation in .yml with optional parameter

老子叫甜甜 提交于 2019-12-04 22:14:43
I want to make a translation my_translation with an optional parameter. For example: > I18n.t('my_translation') => "This is my translation" > I18n.t('my_translation', parameter: 1) => "This is my translation with an optional parameter which value is 1" Is this possible? Yes, definitely. You just write the translations like this: my_translation: This is my translation with an optional parameter which value is %{parameter} Is the parameter really optional? In above translation, you have to provide all parameters. UPDATE: Sorry, I answered too soon. I don't think it's easy to do. Maybe the

How to internationalize metas such as title in view.yml?

我只是一个虾纸丫 提交于 2019-12-04 21:20:34
I'd like to internationalize the strings of my view.yml, I can't find how to do this. I have a solution that is bad, in my opinion: metas: title: <?php echo sfContext::getInstance()->getI18n()->__('TITLE'); ?> I'd like to find a way to do it without calling "sfConfig::getInstance()". Is it possible? Never ever use sfContext for I18n in Configuration-Files! In such a case use the setTitle function in the View (not the controller) <?php $sf_response->setTitle(__('TITLE'));?> Since include_title() does not translate what it finds in view.yml, I made this very simple function in my custom helper:

Font choices in International scenarios: multilingual vs unicode

*爱你&永不变心* 提交于 2019-12-04 20:33:55
I have a website that will eventually display multiple languages. I notice the common fonts used in web CSS (ex: Arial, Verdana, Times New Roman, Tahoma) and even the newer Vista/Office 2007/VS2008 fonts (Calibri,Cambria, Candara, Corbel, etc) are significantly larger (~350K) than your average (US only?) TTF font (~50k) so these fonts contain most/all the major character sets that common languages (Spanish, French, German, etc) use. My question is, would somebody confirm that these fonts listed above are acceptable for international use of the major (let's say top 8) spoken languages? If so,

Marionette + i18n in templates

↘锁芯ラ 提交于 2019-12-04 20:16:06
I want to do some basic i18n in my application I loaded the i18n plugin (from require.js) to my Application and created a directory nls in which i have several files e.g. project.js I set up the default location in main.js file like config : { i18n : { locale : 'de-de' } } I now want to use the files in my View / Template. Can somebody explain to me how this is done? The templates are setup in one template.js file My View: define(['marionette', 'templates', 'i18n!nls/project'], function (marionette, templates, msg) { return marionette.CompositeView.extend({ template : templates.project }); });