internationalization

Change device language on Android 6.0 (Android M)

守給你的承諾、 提交于 2019-12-11 03:50:02
问题 There are applications to change Android device language (locale) via an ADB command. This has required granting the CHANGE_CONFIGURATION permission for the app before language can be changed. On Android 6.0 (API level 23, Nexus 6 device), however, granting the required permission is no longer allowed, since the command adb shell pm grant net.sanapeli.adbchangelanguage android.permission.CHANGE_CONFIGURATION (package name from ADB Change Language app as an example) yields Operation not

i18n search using tire and Globalize3

这一生的挚爱 提交于 2019-12-11 03:36:42
问题 i have a site that uses globalize3 gem (https://github.com/svenfuchs/globalize3) and i'm currently adding the Tire gem to make site search. How do i do to Index a table translations depending on the actual locale? right now the model that gets indexed only does with the default locale. 回答1: You'd have to index all the translations: class Centre < ActiveRecord::Base include Tire::Model::Search include Tire::Model::Callbacks mapping do indexes :title_en, :as => lambda { |post| I18n.locale = :en

Strange symfony i18n error

岁酱吖の 提交于 2019-12-11 03:35:04
问题 I use symfony 1.4.11. In my site I have 3 languages in my site "se","en","no". In my backend, I use only en, and I have in settings: all: .settings: default_culture: en But in some module, when in frontend I have "se" language, have error : Data file for "se" was not found. In frontend I try, make i18n with database; Stack trace: stack trace at () in SF_SYMFONY_LIB_DIR/i18n/sfCultureInfo.class.php line 301 ... if (is_file($filename) == false) { throw new sfException(sprintf('Data file for "%s

how to use i18n for one language cakephp

微笑、不失礼 提交于 2019-12-11 03:28:46
问题 how do I setup i18n just to translate to spanish? I don't want user to change languages on the app, so I just need users to see the app in spanish... I think don't need any routing... am I correct? 回答1: If your website only has a single language, just write your spanish text directly into your view files where it's needed. No need to double the work. If you still want to go with English text in the view files and a Spanish .po file, just set up your app according to the documentation and put

Parameterize h:commandButton

只谈情不闲聊 提交于 2019-12-11 03:25:59
问题 I am using JSF and I would like to parameterize the text of a command button similarly to h:outputFormat . Something like <h:commandButton value="Text {0} some more text" [...] > At the moment I am <h:commandButton value="Text #{bean.value()} some more text" [...] > but this makes me split all the texts stored as properties in two each time I have a parameter <h:commandButton value="#{msg.textbefore} #{bean.value()} #{msg.textafter}" [...] > Any hint? 回答1: We make use of JSF 1.2 and we have

Intl.DateTimeFormat gives strange result from year 1847 or below

不问归期 提交于 2019-12-11 03:25:20
问题 Why is it that if I choose a year below 1848, the result of this format is May 10 ? I have a feeling this could be about time zones? If so how can I avoid this, given that I will be creating a date object from an ISO date string (without time) like this: YYYY-MM-DD . (Tested on Chrome 59) const workingDate = Intl.DateTimeFormat('en-GB').format(new Date('Fri May 11 1848 01:00:00 GMT+0100 (BST)')); const notWorkingDate = Intl.DateTimeFormat('en-GB').format(new Date('Fri May 11 1847 01:00:00 GMT

Struts2 + Internationalization + Java

南笙酒味 提交于 2019-12-11 03:25:10
问题 I am using Struts2 Internationalization to support English & Arabic. I want to know that is it possible to dynamically or automatically change the position of label which comes before any input (text, date, etc.) when the locale changes? E.g. LTR -> English -> First Name - "Input Text Box" RTL -> Arabic -> "Input Text Box" - أول اسم Any possible solution for this? BR SC 回答1: Either (ab)use java.awt.ComponentOrientation String direction = ComponentOrientation.getOrientation(locale)

How to order translated with not translated fields using doctrine knp translatable extentions with A2lix translation form?

微笑、不失礼 提交于 2019-12-11 03:02:37
问题 I'm searching for a simple way to edit translated fields within a symfony2 form. I'm using the doctrine knp translatable extentions for translation of the entity. The form mixes not translated with translated properties in a special order. The form should be displayed (end edit) only in the active language. For example: $builder ->add('key') ->add('translate1','text',array( 'property_path' => 'translations[de].translate1', )) ->add('mynumber') ->add('translate2','text',array( 'property_path'

Change html lang attribute when locale changes

主宰稳场 提交于 2019-12-11 02:41:48
问题 I have a multilangual website running with PHP/Symfony2. I would like to change the html lang attribute when the user switches language (= switching locale). What is the best way to achieve this? PS: my ultimate goal is to be able to switch font for different languages (chinese looks just too bad with the font I chose for english). I am thinking of using the CSS :lang() pseudo selector: html:lang(zh) 回答1: Asuming you are using html5 and twig as template engine: <!doctype html> <html lang="{{

Watch for updated properties in Wicket

ⅰ亾dé卋堺 提交于 2019-12-11 02:39:04
问题 In my current project we need to implement a way for texters to manage the wicket messages/internationalization via upload of property files. Also see this question: Administrating internationalized wicket applications As suggested there, I've implemented a custom IStringResourceLoader and added it at the beginning of the StringResourceLoader list to override any properties already in place: getResourceSettings().getStringResourceLoaders().add(0, new CustomStringResourceLoader()); This