Не хочет работать русская локаль в ROR 4.1.4, что может мешать подключению?

class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s]
    config.i18n.default_locale = :ru
  end


Ставлю локаль русскую, заметил что перевод не срабатывает, полез в контроллер и сделал так:
abort I18n.default_locale.inspect

на что получаю
:en

Файл с переводом существует
b60b32c746fc4250a2713334cf7b000f.png
  • Вопрос задан
  • 2281 просмотр
Пригласить эксперта
Ответы на вопрос 2
@mstfa
надо добавить :ru в config.i18n.available_locales, так как по умолчанию config.i18n.enforce_available_locales = true

ну или сделать config.i18n.enforce_available_locales = false
Ответ написан
FanKiLL
@FanKiLL
А сам файлик ru.yml есть?
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы