Questions tagged [rails-i18n]

Repository for collecting Locale data for Ruby on Rails I18n as well as other interesting, Rails related I18n stuff.

About

The Ruby I18n (shorthand for internationalization) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for translating your application to a single custom language other than English or for providing multi-language support in your application.

The process of "internationalization" usually means to abstract all strings and other locale specific bits (such as date or currency formats) out of your application. The process of "localization" means to provide translations and localized formats for these bits.

Links:

  1. Homepage
  2. Guide
778 questions
0
votes
2 answers

Stripping HTML markup from a translation string

I have some translations that I use in my views. These translations sometimes return very basic HTML markup in them - t("some.translation") #=> "This is a translation with some markup
" (Side note: I'm using the fantastic…
user2490003
  • 10,706
  • 17
  • 79
  • 155
0
votes
1 answer

Russian characters are not displayed when i create an object

rails 3.2 ruby 2.0 There is a form to create or edit a poll: = f.error_messages header_message: nil = f.input :question, input_html: { class: 'input-block-level' } = f.input :results_hidden, as: :boolean, inline_label: 'Скрыть результаты до…
Stefan Hansch
  • 1,550
  • 4
  • 22
  • 55
0
votes
1 answer

Change date format in Rails validates_timeliness error messages

The validates_timeliness gem says it supports I18n for its error messages. However, I can't find any configuration (or documentation) to show me how to modify the date format on error messages it generates. There is a DEFAULT_ERROR_VALUE_FORMATS in…
Ian M
  • 91
  • 1
  • 5
0
votes
1 answer

Rails i18n language change spontaneously

I m trying to use i18n with rails, but there was a mistake I did not handle. config/initiliazers/locale.rb I18n.load_path += Dir[Rails.root.join('lib', 'locale', '*.{rb,yml}')] I18n.default_locale =…
Ramazan Zor
  • 209
  • 1
  • 14
0
votes
1 answer

unable to get the locale from client after Rails & Ruby update

formerly, I used Rails 3.2.13 with Ruby 2.0.0 and this worked fine : In my application.rb, I had: def set_locale I18n.locale = http_accept_language.compatible_language_from([:en, :de]) end I use 2 locales, de.yml and en.yml Now that I…
cedric
  • 223
  • 5
  • 12
0
votes
2 answers

Route error I18n and rspec

In app I use gem "I18n" for internationalization. All worck ok, but in aceptance tests, I receive an error: Failure/Error: expect(current_path).to eq profile_path expected: "/profile" got: "/en/profile" (compared using ==) Test: …
alexin
  • 243
  • 1
  • 15
0
votes
1 answer

Rails admin navigation_label translation

I'm localizing Rails app with Rails Admin using I18n. In some models (Good < ActiveRecord) Rails admin configured as follows: rails_admin do label = 'Good' label_plural = 'Goods' navigation_label = 'Settings' navigation_icon =…
pasha.zhukov
  • 1,272
  • 10
  • 9
0
votes
1 answer

How to set name of class in .yml in Rails

I have an_errors.html.erb that takes an object and has <%= object.class.name %>. It is called by this in a _form.html.erb: <%= render 'shared/errors', object: @product %> What should I write in my xx.yml file to find the translation? I have…
abegbg
  • 191
  • 2
  • 11
0
votes
1 answer

I18n::InvalidLocaleData: can not load translations with sidekiq and jruby

I have jruby-9.0.5.0 setup and i try to do some parallel processing using sidekiq. Everything works fine, except that if i use more than 12 sidekiq threads, i keep getting the following error message: WARN: I18n::InvalidLocaleData: can not load…
Gerold
  • 29
  • 4
0
votes
4 answers

Middleman i18n not working

I'm newbie using ruby and middleman, I've created my project and all are working fine, but when I go to /es path I don't get any translation. I've searched for info without any results and tried to move code between folders testing configs and…
0
votes
3 answers

Ruby on rails. Many to many categories

I am struggling with choosing the best way of modeling categories in my project. Users create gigs, and each gig can have multiple genres. Genres must be searchable with ransack and translatable. Here is what I've tried: Ive read that…
Rob Hughes
  • 876
  • 2
  • 13
  • 32
0
votes
1 answer

Rails. Undefined method `scan' for :en:Symbol

I am trying to set up internationalization in my rails app. Use this article https://lingohub.com/blog/2013/08/internationalization-for-ruby-i18n-gem/ But I have error: Failure/Error: http_accept_language.scan(/^[a-z]{2}/).first …
alexin
  • 243
  • 1
  • 15
0
votes
1 answer

How to loop through all available I18n variables in Rails 4

I have a certain numbers of I18n locale available defined in application.rb config/application.rb ... config.i18n.available_locales = [:at, :de, :ch] ... I need to manually expire the cache for all languages at once in certain controller actions.…
0
votes
1 answer

Default options for the i18n translations gem

I have a rails app the uses the standard i18n translations gem. It's a multi-tenant app and relies on parsing the current tenant from the subdomain. en: foo: bar: "Welcome to %{subdomain}" I have a few keys (e.g. subdomain above) that I'm…
user2490003
  • 10,706
  • 17
  • 79
  • 155
0
votes
1 answer

Rails 4.2.4 ActiveAdmin Globalize show one input only

Here I have a problem when using rails 4.2.4 + activeadmin 0.6.6 + rails-i18n 4.0.8 + globalize 4.0.3 + activeadmin-globalize 1.0.0 . The problem I am facing is shown in the following image, it only show one input box for me: In the contact table,…
Wing Choy
  • 900
  • 10
  • 25