internationalization

Client-side HTTP_ACCEPT_LANGUAGE access? JavaScript? I don't see a JQuery wrapper. Static pages to detect preferred language!

旧城冷巷雨未停 提交于 2019-12-08 09:56:28
问题 I'm trying to access user's language preference w/o using server code. I'm looking for some JavaScript like this: var language_array = jQuery.languagePreferences(); //en-ca,en;q=0.8,en-us;q=0.6,de-de;q=0.4,de;q=0.2 I know I can use HTTP_ACCEPT_LANGUAGE on server side, but what about in JavaScript/JQuery client-side static (non-server generated) page? I've done a fair amount of Googling and have no clear browser agnostic solution.. how does JavaScript gain access to browsers' list of preferred

React native multi-language issue

放肆的年华 提交于 2019-12-08 09:50:35
问题 I have small react native app where I'm trying to implement multi-language that reload components in real time when I change language. I'm using react-native-i18n library. I have my Language component and here is the code: constructor(props) { super(props); this.state = { selected: 'sr_ME' }; } async componentDidMount() { let currentLanguage = await this.getLocalKey('lang', 'sr_ME'); this.setState({ selected: currentLanguage }); } getLocalKey = async (key, defaultValue) => { try { let value =

symfony i18n objects (Doctrine) get specific culture

寵の児 提交于 2019-12-08 09:25:37
问题 I am having an issue where I cannot retrieve a specific translation from my i18n doctrine objects. If I call $object->getName(); I get the name in the current culture as expected. However, if I wish to retrieve a specific translation without switching the user culture... $object->getName('fr'); I still get the current culture instead of French in this example. This $object->getTranslation()->fr->name; does work though. What am I doing wrong? Isn't $object->getName($culture); the correct way

Spring MVC 3 localeChangeInterceptor

依然范特西╮ 提交于 2019-12-08 08:59:35
问题 I want to add Internationalization to my Spring MVC application. I know it can be a copy question but I have tried all solutions from both stackoverflow and google but still could not get working. I will explain in details. Here is web.xml <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/root-context.xml</param-value> </context-param> root-context.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"

Symfony 1.4 compatible I18N translation system?

我的梦境 提交于 2019-12-08 08:32:12
问题 I am migrating a small app from Symfony into a separate project, and the only Symfony component that it depends on is I18N string translation. By example: action.class.php : $this->culture = 'pt_BR'; templates/search_box.php : <h1><?php echo __('Destination') ?></h1> i18n/pt_BR/messages.xml : <?xml version="1.0" encoding="UTF-8"?> <xliff version="1.0"> <file datatype="plaintext" source-language="en" target-language="pt_BR" original="messages"> <body> <note> SEARCH BOX </note> <trans-unit id=

interface language selector in rails form?

Deadly 提交于 2019-12-08 08:19:45
问题 What would be the way to go on having a locale selection drop down in a form? I have a User model with a column "lng" where I store the "en","fr", etc i18n locale strings. My goal is to have a drop down with all the languages listed " English ", " French " and on form update it stores the correct "en", "fr" value in the user table. What would be a way to go on this? 回答1: You can simply use the select tag http://guides.rubyonrails.org/form_helpers.html#the-select-and-option-tags: = form_for

Java Playframework Internationalization doesn't work

五迷三道 提交于 2019-12-08 06:33:19
问题 I used the instructions from here: http://www.playframework.org/documentation/1.2.1/i18n and created files for different languages. I call play.i18n.Lang.change method to change the language file, and it still takes the captions from the English file ("messages" without a suffix), Any ideas why? 回答1: It is hard to know from your description exactly what the problem may be, so I have outlined how you should do a multi-lingual app. There are a number of steps you must follow to get

Unable to use I18n.t call in an initializer file in Rails 3.1.1

China☆狼群 提交于 2019-12-08 05:58:12
问题 I would like to use I18n.t in an initializer file in Rails 3.1.1. This question already exists for Rails 2 (http://stackoverflow.com/questions/3514536/unable-to-use-i18n-t-call-in-an-initializer-file). Supposedly, it was answered by a subsequent release. It appears to be an issue again in Rails 3.1.1. The problem: I have a custom time format called :dxl. I would like to format my Email.sent_at datetime as :dxl. The solution: In can add the format to en.yml (time.formats.dxl) and use it with:

iphone application international sales

陌路散爱 提交于 2019-12-08 05:25:03
问题 Would anyone be able to give a "best practices" summary for creating an app targeted internationally? How to prepare the app for translations "espanol, english, korean, chinese etc.) What sort of measures do you need in the approval process? do you submit one APP or is it several? How to optimize your iTunes store page to work across different languages. all the best! 回答1: This is actually pretty well documented by Apple. Basically you don't hardcode strings in your program. You put them in a

Can I get entire i18n labels of specific dictionary

安稳与你 提交于 2019-12-08 05:22:30
问题 I am facing an issue with i18n labels. My application reads few i18n labels at js frontend using Granite.I18n.get('') function. The entire dictionary gets downloaded as ‘/libs/cq/i18n/dict.{+locale}.json’ as dictated in ‘/etc/clientlibs/foundation/shared/source/init.js’. Now the en dictionary returns only the custom labels and is small size. But other languages like fr,the dictionary file is aggregation of all /libs dictionary and is very huge. I noticed this in few other sites also.