internationalization

Starting rails I18n and url helpers seem to confuse locale with id

此生再无相见时 提交于 2019-12-11 06:19:42
问题 I have just started trying to update our rails 3.2 app for internationalization. I have an optional scope in the routes, like scope "(:locale)", locale: /en|es|zh-HK|de|fr/ do as described by http://guides.rubyonrails.org/i18n.html. And my url helper like watch_url(@watch) gets errors in the form No route matches {:action=>"show", :controller=>"watches", :locale=>#<Watch id: 1, rule_name: "MyRule", start_time: "2014-06-08 03:30:03", end_time: nil, last_execution_time: nil, frequency_mins: 60,

Using CultureAndRegionInfoBuilder to update built-in .Net culture

℡╲_俬逩灬. 提交于 2019-12-11 06:01:35
问题 I'm attempting to change the built in .Net culture fr-CA, using the following method: CultureAndRegionInfoBuilder cib = new CultureAndRegionInfoBuilder("fr-CA", CultureAndRegionModifiers.Replacement); try { Console.WriteLine("Updating " + cib.CultureName); cib.NumberFormat.CurrencyGroupSeparator = ","; cib.NumberFormat.CurrencyDecimalSeparator = "."; cib.NumberFormat.NumberGroupSeparator = ","; cib.NumberFormat.NumberDecimalSeparator = "."; cib.Register(); Console.WriteLine("Culture updated."

Can't display multi byte string on MonoDevelop Mac OS X

别等时光非礼了梦想. 提交于 2019-12-11 06:00:01
问题 The problem is following one line code: Console.WriteLine ("あ"); This results in the following output in Application Output window: ? How can I display "あ" instead of "?" in Application Output window. I made sure following things: The source code encoding is UTF-8 I selected Japanese font set "Osaka Regular-Mono" (Preferences > General > Font) Executing the exe from a terminal, "あ" is displayed correctly on terminal window On Ubuntu's MonoDevelop, "あ" is displayed correctly in Application

Configure Translation component in Symfony 2 to use gettext

落爺英雄遲暮 提交于 2019-12-11 05:19:17
问题 Symfony 2 as version 2.1 supports gettext (MO and PO files). I have following configuration ( app/config/config.yml ): framework: translator: { fallback: "en" } default_locale: "fa_ir" ... How can I configure to support for mo files? 回答1: I found without any configuration I can put messages.fa_ir.mo in Resources/translations directory of bundle and Symfony2 itself will find it... 来源: https://stackoverflow.com/questions/13218175/configure-translation-component-in-symfony-2-to-use-gettext

Unable to translate text using ngx-translate's service-translate.get

我是研究僧i 提交于 2019-12-11 04:39:33
问题 I am able to translate text using translate pipe but currently struggling to load translations using translate service's get and instant method. Below is my code in app.component.ts export class AppComponent { event : string; constructor(private translate: TranslateService) { translate.addLangs(["en", "fr"]); translate.setDefaultLang('en'); let LangChangeEvent : {} let browserLang = translate.getBrowserLang(); translate.use(browserLang.match(/en|fr/) ? browserLang : 'en'); this.translate.get(

symfony link to change language and stay on the page

扶醉桌前 提交于 2019-12-11 04:38:50
问题 I would like to make a link the will be in the layout to change the language. So it should work for many routes. for example i'm on the page /en/myModule and the links should point to /de/myModule /fr/myModule I found a solution here :http://oldforum.symfony-project.org/index.php/m/70452/ <?php echo link_to( 'Germany', '@default?' . http_build_query(array( 'sf_culture' => 'de', 'module' => $sf_request->getParameter('module'), 'action' => $sf_request->getParameter('action')) ), null, '&')) ?>

Converting mysql database to support multiple languages

青春壹個敷衍的年華 提交于 2019-12-11 04:22:22
问题 I currently have a database and most of the tables and fields are stored as latin1_swedish_ci. My questions are: Should I use utf8_unicode_ci for the tables and their fields? What is the difference between a collation for a table vs a field? Can I mass change all fields/tables to utf8_unicode_ci? (if thats the right collation) Can any data loss happen in the fields/tables? The reason I want to use utf8 is because I need to store Chinese and/or Russian chars in the database. 回答1: I'd go for it

Yii modules internationalization

吃可爱长大的小学妹 提交于 2019-12-11 04:08:02
问题 Yii Doc: Modules can be nested in unlimited levels. That is, a module can contain another module which can contain yet another module. We call the former parent module while the latter child module. Child modules must be declared in the modules property of their parent module, like we declare modules in the application configuration shown as above. I try to create myltilingual application using Yii::t() function: Yii Doc: And when using Yii::t() to translate an extension message, the

Django: wrong language preference

…衆ロ難τιáo~ 提交于 2019-12-11 04:06:06
问题 I use Django to create a web project in two languages: english and german. The default language of the document is english and I translated it in german by my own and created a .po file. My idea is that if someone speaks german and the browser's locale is set to "de", Django should switch to german (the translation i provide). BUT in every other case, it should switch to english. The problem is that it exactly works the other way round and I have no clue why! Status quo: If the browser's

Effective way to structure translations in RoR?

血红的双手。 提交于 2019-12-11 04:03:22
问题 I was hoping somebody could look this over, as I've never translated anything but English before, and so I'm not sure if there would be grammatical conflicts. I have: en: articles: name: "Articles" comments: name: "Comments" # things no_results: "There are no %{things}" my: "My %{things}" Then in a view file, for example: #title= t('articles.name') %ul %li= link_to t('my', things: t('articles.name')), articles_path(user) .no_results= t('no_results', things: t('comments.name').downcase) What I