This is an extremely bizarre one. In my en and es.yml localization files, I have this block for the products controller:
products:
word: Products
show:
exam: "Exam:"
related: "People who bought this, were also interested in..."
buy_now: Buy Now
Now, this works 100% when the site is in English, but when it’s in Spanish using the es.yml locale I get a missing translations error!? I’ve checked the spacing, indentation, possible repeats of a products key, etc and nothing. When I try to reference it directly (i.e. <%= t('products.show.exam') %>) it still does not work.
If, however, I change the key to ANYTHING except “products” and then reference it directly, it works fine.
Has anyone ever seen anything like this? Im in Rails 2.3.12 BTW.
The word “Products” only occurs once, in a comment in the YAML documentation. So, it’s not a reserved directive in YAML:
http://yaml.org/spec/1.2/spec.html
It is not in the Ruby specification either, so it’s not a Ruby reserved word:
http://ruby-doc.org/stdlib-1.9.3/
I also checked the spanish version of Ruby documentation, which just directed me to the English documentation:
http://www.ruby-lang.org/es/documentation/