Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Active Admin Translation Missing

I've translated my app to another language. I've created ru.yml file with all translations needed in views in it. All worked fine before I go to admin path. I use Active Admin and I've got following error:

I18n::MissingTranslationData in Admin::Pages#index

translation missing: ru.time.formats.long

insert_tag renderer_for(:index)

How to fix it? I'm interested in both ways: what to do to translate Active Admin too and what to do if I want to keep it in English and just fix the error message.

like image 828
femalemoustache Avatar asked Dec 02 '14 18:12

femalemoustache


2 Answers

That was easier than it looked at first. I've just added the following lines to my ru.yml file.

time:
 formats:
   long: "%Y-%m-%d %H:%M:%S"
like image 112
femalemoustache Avatar answered Sep 17 '22 05:09

femalemoustache


Recently, I've been through the same issue and a quick way to get all default Rails translations set is using the rails-i18n gem.

For that you need to add it into your project's Gemfile just like this:

# Gemfile
...
gem 'rails-i18n'

Don't forget after this to run:

bundle install

I hope this becomes helpful to some other folks in the future.

like image 33
fagiani Avatar answered Sep 20 '22 05:09

fagiani