internationalization

what is best practice to implement i18n usage java? [closed]

99封情书 提交于 2019-12-07 00:30:04
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago . what is best practice to implement i18n using java ? 回答1: You can use ResourceBundle.getBundle( name ) which returns the correct bundle according to the user locale and get specific messages. The way the

rails3 I18n: can't override “1 error prohibited this packet from being saved:”

心已入冬 提交于 2019-12-06 22:29:09
问题 When i get errors on model Packet, i always see the first (english=not translated) line: 1 error prohibited this packet from being saved: Naam Gelieve het veld Naam in te vullen! The translations for the error for the single field is found! While i have the following in my nl.yml nl: activemodel: errors: template: header: one: "1 fout voorkwam dat dit %{model} kon bewaard worden" other: "%{count} fouten voorkwamen dat deze %{model} kon bewaard worden" body: "Er waren problemen met de volgende

Charset.defaultCharset() get different result under JDK1.7 and JDK 1.6

穿精又带淫゛_ 提交于 2019-12-06 22:25:45
问题 I am testing my application's i18n compatibility. I have a English version of Windows 7 which mean the system's display language is English. And I set the system locale as Chinese for non-unicode application. My application encountered problems when exporting Html files with Chinese character under jdk1.6, but works fine when running under jdk1.7. I debugged it and found the direct reason was that Charset.defaultCharset() returned different values. Under jdk1.7 Charset.defaultCharset()

Search engines and browser accept-language

非 Y 不嫁゛ 提交于 2019-12-06 20:26:10
问题 I'm building a web portal where language content will generally depend on the "accept-language" sent by the browser. The same content-URI will thus serve different content to different users depending on their browser setting. I'm very curious to know how this will affect search indexing. Does Google index using all languages, and is it handled well? 回答1: They don't send accept-language, so the site will be indexed in the default language that you select. I recommend you to have different URL

Does my Base Internationalization storyboard have to correspond to a fallback language for all unlocalized languages and strings?

爷,独闯天下 提交于 2019-12-06 19:50:32
问题 I've looked through some internationalization documentation and videos on apple developer, but I never found an explicit answer to that question. In Apple's tutorials I see the Base.lproj folder alongside en.lproj and zh.lproj -- the example translation (localization) is from English to Chinese. But they tell me that there's a file en.lproj/myStoryboard.strings , and that is confusing. I can't see the point in creating an English localization for the storyboard (that is already in English).

How can I translate the ActiveRecord attribute name in Rails 3.2?

北慕城南 提交于 2019-12-06 19:48:56
问题 I have the following validation in my model ( User ): validates :first_name,:length => {:minimum => 2,:maximum => 50},:format => { :with => /[a-zA-Z]+/ } I have the following in my yml locales file: attributes: first_name: too_short: "First name is too short" too_long: "First name is too long" invalid: "First name is not valid" Now, if I start a rails console , and write the following: a = User.new a.valid? a.errors.full_messages I will see the following errors: ["First name First name is too

How to Integrate Qt4 qm files into binary using cmake and QRC?

北城以北 提交于 2019-12-06 18:51:50
问题 I have a Qt4 CMake project and I'd like to integrate the QM files for i18n into the output binary. These are the rules I have so far for generating the TS and QM files: set(myapp_TRANSLATIONS i18n/myapp_de.ts ) set(FILES_TO_TRANSLATE ${myapp_SRCS} ${myapp_MOC_HDRS} ) QT4_CREATE_TRANSLATION(QM_FILES ${FILES_TO_TRANSLATE} ${myapp_TRANSLATIONS}) QT4_ADD_TRANSLATION(QM ${myapp_TRANSLATIONS}) I tried the following to add the QM files to the executable: add_executable(myapp ${myapp_SRCS} ${myapp

I18n::InvalidLocale: :en is not a valid locale

拟墨画扇 提交于 2019-12-06 18:21:48
问题 I am trying to use I18n.transliterate to "normalize" some text with accented characters so I can analyze and compare it with different languages. However, when using this method the following error pops out I18n::InvalidLocale: :en is not a valid locale from /home/xxx/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n.rb:284:in `enforce_available_locales!' from /home/xxx/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n.rb:235:in `transliterate' from (irb):2 from /home/xxx/.rvm/rubies/ruby-2.1.5/bin

How to convert float or currency to a localized string?

一世执手 提交于 2019-12-06 17:30:41
问题 In Delphi 1 , using FloatToStrF or CurrToStrF will automatically use the DecimalSeparator character to represent a decimal mark. Unfortunately DecimalSeparator is declared in SysUtils as Char1,2: var DecimalSeparator: Char; While the LOCALE_SDECIMAL is allowed to be up to three characters: Character(s) used for the decimal separator, for example, "." in "3.14" or "," in "3,14". The maximum number of characters allowed for this string is four, including a terminating null character. This

Organization of Locale Files in rails app

无人久伴 提交于 2019-12-06 17:15:24
问题 I currently have the following 4 files in my config/locales of my root application: -en.yml -de.yml -simple_form.en.yml -simple_form.de.yml In my application.rb which resides in a spec/dummy folder for testing the application gem I have the following line of code which seems to be retrieving the translations as expected: # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to