I am getting a bit frustrated with the chapter on Internationalization. On page 200 it seems that I should be getting an error in the flash when I try to switch languages before I start making those language files in the config/locales directory . . . but this isn’t happening! I can’t understand what I am doing wrong.
When I used the depot_s code from the site(with my own database) and I omitted the es-ES file, instead of getting an error in the flash, the app threw an exception: ` No such file or directory - /Users/myUserName/code/depot_s/config/locales/es-ES.yml ` I just wanted to see if everyone is experiencing this behavior? Or if anyone has a clue on where I can begin investigating where my code is going wrong?
Thanks so much ahead of time!
EDIT: Continued investigation:
Aright, I am really missing something here. I decided to soldier on with the code, on the off chance that I had it all correct, but there was something else awry.
A little history on my code: I have been following the AWDWR book precisely, and had no problems at all! It’s been great. I was in the middle of the Testing chapter when I got the updated beta book on the 26th of december. Today I moved from that chapter and started working through the i18n chapter.
In addition to what I wrote above, I continued on to page 201 and 202 writing the code from the book as I went along. In case of session issues, after every server restart I have been doing a rake db:sessions:clear. Every time I attempt to load the index page I now get this error:
ActionView::TemplateError (You have a nil object when you didn’t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.inject) on line #21 of app/views/layouts/store.html.erb: 18: <% end %> 19: 20: <%= image_tag(“logo.png”) %> 21: <%= @page_title || I18n.t(‘layout.title’) %> 22: 23: </div> 24: <div id="columns">
The code, depot_s, from the book works correctly and functions as it should. I have attempted to replace all of the code I have written with the working code . . . substituting the three files created/altered with the working copy in the depot_s code. The error persists.
On the off chance that the code in the previous chapters had changed since the last iteration of the beta book, I went ahead and used an diff app called “Changes” to compare my code with depot_s, and I can’t seem to find any major differences that would be causing this problem.
I am wondering what my next investigative step should be . . . anyone have an idea of my next place to hunt down this bug I am having?
Once again, thanks for helping me track it down. I would rather find the problem with my own code, then go back and start again . . . and I am usually really good at tracking down bugs, but this one is REALLY eluding me!