internationalization

Locale not set in Application Controller

对着背影说爱祢 提交于 2019-12-25 11:46:18
问题 I've spent the last few hours trying everything possible to make this work, googled, redesigned, tested, etc. - but somehow doesn't get it working. ok, I would like to set the I18n.locale - fairly simple. Basically I implemented what is written on the guide here: http://guides.rubyonrails.org/i18n.html Application_controller.rb before_action :set_locale def set_locale I18n.locale = params[:locale] || I18n.default_locale end In fact mine looks like this: class ApplicationController <

Locale not set in Application Controller

馋奶兔 提交于 2019-12-25 11:44:56
问题 I've spent the last few hours trying everything possible to make this work, googled, redesigned, tested, etc. - but somehow doesn't get it working. ok, I would like to set the I18n.locale - fairly simple. Basically I implemented what is written on the guide here: http://guides.rubyonrails.org/i18n.html Application_controller.rb before_action :set_locale def set_locale I18n.locale = params[:locale] || I18n.default_locale end In fact mine looks like this: class ApplicationController <

How to compare Chinese strings in English environment?

牧云@^-^@ 提交于 2019-12-25 08:49:57
问题 I'm trying to compare Chinese strings with NSString - (NSComparisonResult)localizedStandardCompare:(NSString *)string method. It works correctly if the system language is set to Chinese. But in English language environment, the strings is compared by something like unicode number. How can I compare strings with Chinese style in English environment? 回答1: Use - (NSComparisonResult)compare:(NSString *)aString options:(NSStringCompareOptions)mask range:(NSRange)range locale:(id)locale instead. 来源

Add custom language for localization in Django app

瘦欲@ 提交于 2019-12-25 08:47:40
问题 adding a custom language to django I checked this question and did all the steps mentioned in the accepted answer. After doing all when I go to /kjv/ then it redirects to /en/kjv/ Project structure: MyProject ---------locale -------------kjv -----------------LC_MESSAGES --------------------django.mo --------------------django.po ---------myproject --------------settings.py ---------app ---------manage.py Some one can help me to fix this? settings.py ... import django.conf.locale gettext =

angularjs internationalize dynamic label

北慕城南 提交于 2019-12-25 05:34:06
问题 I'd like to internationlize label fetched dynamicaly. I've tried something like this wihtout success: <span class="nav-label">{{'{{menu.title}}' | translate}}</span> Any idea? function config($translateProvider) { $translateProvider .translations('en', { dashbord: 'Dashboard', }) .translations('fr', { dashbord: 'Tableau de bord', }) ; $translateProvider.preferredLanguage('en'); } 回答1: You want to translate the key contained in $scope.menu.title , right? So use {{ menu.title | translate }} 来源:

localization in Chrome extensions

帅比萌擦擦* 提交于 2019-12-25 04:45:31
问题 I have a query related to localization of Chrome extensions. I am trying to localize the text in a button in a popup html file in my extension. The code I am using is as follows: <button name="buttonSave" id="buttonSave" style="width: 100px; float: right;"> <label class="buttonTextStyle"> </label> </button> The javascript code is as follows: document.getElementById("buttonSave").innerText = chrome.i18n.getMessage("SaveButton"); I have tried using innerText, innerHTML, value but the text in

How to validate format string

笑着哭i 提交于 2019-12-25 04:30:18
问题 We have lots of strings in our resource files that contains format .e.g “{0} has moved to {1}” These strings are passed to String.Format() by the applications, sometimes the translators mess up the “formatting markers” Therefore I wish to find/write a tool that checks that all strings in the resource file has a valid format. I know for each key the numbers of args that are passed to String.Format so that can feed into the validations as well. So apart from checking that the “{“ match the “}”

Translation .po file is not called

梦想与她 提交于 2019-12-25 04:14:30
问题 I can't translate my wordpress plugin. I have my .po and .mo files inside the plugin-name/languages folder but it doesn't work. Does anyone have a clue on what could be missing? Details: I translated the theme using the .po and .mo files and adding define('WPLANG', 'pt_BR'); on wp-config.php . It works fine. But not all website is translated. So I tried the same with the plugins, but even translating the plugin .pot and naming plugin-name-pt_BR.po and plugin-name-pt_BR.mo , and placing them

how can I change buttons's text in org.eclipse.jface.wizard.Wizard

*爱你&永不变心* 提交于 2019-12-25 03:55:24
问题 I want to change text of button in org.eclipse.jface.wizard.Wizard to arabic in button bar? I mean I wanna change label "Next" button to "بعدی". 回答1: The language of the Wizard 's labels is handled by JFace and uses your OS's region settings. That means if you're machine is set to "English (UK)" you will see the labels in English, if it's set to "Germany" you'll see them in German, etc. There are related questions here: JFace dialog button translation How to set custom text on buttons in

configurable application texts

我是研究僧i 提交于 2019-12-25 03:48:12
问题 My application is shipped to many different customers, who all want to have control on the texts that the application displays (for example- one customer wants to display 'the operation completed successfuly', the other 'operation completed' and another 'tres bien'). So basically the requirement here is to allow the customer to edit those things 'on the fly' via a GUI. In the future, we might want to add the option of 'placeholders' (i.e. 'operation {0} completed' where {0} is the ID of the