internationalization

The orders of bean validation default parameters?

霸气de小男生 提交于 2019-12-12 08:33:14
问题 I am currently trying to provide a custom validation message using bean validation. Currently using spring mvc 3.1.1 + apache bean validation. In my bean, i specify : @Size(min=1, max=50) private String title; And in my messages.properties : Size.addForm.title=The title must not be empty and must not exceed {1} characters. From experiment, i found out that : {0} refers to 'title' {1} refers to the max, which is 50 {2} refers to the min, which is 1 and it'll be displayed as The title must not

How can I programmatically find the list of codecs known to Python?

霸气de小男生 提交于 2019-12-12 08:15:17
问题 I know that I can do the following: >>> import encodings, pprint >>> pprint.pprint(sorted(encodings.aliases.aliases.values())) ['ascii', 'base64_codec', 'big5', 'big5hkscs', 'bz2_codec', 'cp037', 'cp1026', 'cp1140', 'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', 'cp1256', 'cp1257', 'cp1258', 'cp424', 'cp437', 'cp500', 'cp775', 'cp850', 'cp852', 'cp855', 'cp857', 'cp860', 'cp861', 'cp862', 'cp863', 'cp864', 'cp865', 'cp866', 'cp869', 'cp932', 'cp949', 'cp950', 'euc_jis_2004', 'euc

Get an ISO 15924 script code for a given IETF Language tag (or ISO 639-ISO 3166-1 pair)

送分小仙女□ 提交于 2019-12-12 08:14:05
问题 I'm integrating ICU into some in-house software. I'd like to be able to take a string such as "en_US" and get the script name "Latin" for it. (Though ultimately I actually want an ICU ScriptCode.) I tried using ICU's Locale class, but this code: Locale *ul = new Locale("en_US",); LOG(ul->getScript()); Logs an empty string, despite the documentation indicating that this is the use case. I even tried it using the Locale class' static method Locale::getEnglish and still got an empty string. I'm

IE8 font-size toggles on :hover - Japanese lang only

十年热恋 提交于 2019-12-12 07:53:03
问题 I have a page that is multi lingual and I have an issue with the Japanese version only. For some reason in IE8, when I hover over an element, a sibling's font-size will increase/decrease. Even stranger, is that this doesn't happen on every hover, sometimes I cannot reproduce straight away, I need to keep hovering over different elements in the same area of the page. Eventually this bug will rear its ugly head. This bug only occurs on the Japanese page, all other languages seem to be fine.

Symfony2: How to translate custom error messages in form types?

送分小仙女□ 提交于 2019-12-12 07:40:08
问题 I need to translate the error messages from my form type. Here is my form Type code: class ReferFriendType extends AbstractType { public function buildForm(FormBuilder $builder, array $options) { $defaultSubject = "This is a default referral subject."; $defaultMessage = "This is a default referral message."; $builder->add('email1', 'email',array( 'required' => true, 'label' => 'Email 1* :', 'attr' => array('class' => 'large_text'), )); $builder->add('email2', 'email',array( 'label' => 'Email

Globalize an existing Windows Forms application?

随声附和 提交于 2019-12-12 07:30:56
问题 I have an existing winforms application developed using VS 2005 and .net framework 2.0. Now we need to globalize this application. The two locales are German and Japanese. I know we can use form's localize property to create localized form resources and can have other resource files for strings used in message boxes, exceptions etc.. I want to know the best approach to globalize an existing application, should I set the localize property on each form or is there some tool which will extract

How to put JSF message bundle outside of WAR so it can be edited without redeployment?

纵然是瞬间 提交于 2019-12-12 07:26:55
问题 We have a JSF application on WildFly 8 which uses the traditionally mechanism with internationalizing text by having message bundles for German and English in the WEB-INF\classes folder of the WAR and a configuration in faces-config.xml mapping a name to it and listing the locales. The application does not have a database connection, but uses REST services to communicate with a 2nd application. Now we need to be able to change text more easily, meaning not having to build a new WAR file and

playframework 2.2 java: how to set language (i18n) from subdomain

假装没事ソ 提交于 2019-12-12 07:18:47
问题 How can I set the language (i18n) not only from the users browser settings but also from subdomains (which should have higher priority) in playframework 2.2 (java)? The following should work: example.com -> english or german, depending on browser settings en.example.com -> force english de.example.com -> force german The user should be able to switch between subdomains without losing the session. Because I have a lot of java controllers, it would be great if the solution works in a

Implementing Spring i18n and L10n on my REST API

我怕爱的太早我们不能终老 提交于 2019-12-12 05:37:27
问题 I am developing an API which has to support multiple languages, I am using #Spring i18n and L10n for this purpose. I am using Java configurations to define the beans as below: ================================================================================== @Bean public MessageSource messageSource() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasename("resources/StatusMessageSource"); // messageSource

URL rendered as home_page after internationalization

Deadly 提交于 2019-12-12 05:29:10
问题 I have a Django Website that I am trying to internationalize. Until now it looked like this: Homepage: www.myhomepage.com Another page: www.myhomepage.com/content/cities Now I am trying to make it like this: Homepage: www.myhomepage.com/en www.myhomepage.com/de Another page: www.myhomepage.com/en/content/cities www.myhomepage.com/de/content/cities Following this and this, I managed to make the homepage work, so with www.myhomepage.com/en I see the homepage in English and with www.myhomepage