Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error I18n::InvalidLocaleData

I want use I18n and I already follow on how to do that from railscast but the thing gone wild and I don't know where the mistake, had tried check the format, tried several ways but still can't be done.

my en.yml

en:
  category:
    index:
      title: "Listing Categories"
      name: "Name"
      is_active: "Is Active"

my view

<%= t 'category.index.title' %>

But return I18n::InvalidLocaleData in Categories#index and can not load translations from /home/lenovo/cost_control/config/locales/en.yml, expected it to return a hash, but does not

I had try on my en.yml just:

en:
  title: "Listing Categories"

and can work perfectly, but when I adding more line, just return me those error. I'm sorry I just not so advanced yet in rails, thank you for the help you guys :D really.

like image 753
ksugiarto Avatar asked Mar 11 '13 05:03

ksugiarto


1 Answers

It seems your YAML is broken. Didn't you use tabs instead of spaces?

You can use YAMLlint to check YAML for validity.

like image 160
Ilya Khokhryakov Avatar answered Oct 26 '22 13:10

Ilya Khokhryakov