diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-06-17 15:02:10 -0700 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-06-17 15:02:10 -0700 |
commit | 52d43ecf01cc22aa0fcad82f46b577bb55126ccc (patch) | |
tree | f79b3f7ddf1d95f040d027c7650c25c48f60dee2 /app | |
parent | b1bb9d81f624936a49142c8f98fd7f0643e169fe (diff) | |
parent | 4a4169c606e0e26b905e11e1fc75c45268498112 (diff) |
Merge branch 'hotfix/0.11.0.13' into wdtk
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application_controller.rb | 5 | ||||
-rw-r--r-- | app/views/general/blog.html.erb | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a8ba52e4f..acf366bfb 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -51,6 +51,9 @@ class ApplicationController < ActionController::Base anonymous_cache(24.hours) end + # This is an override of the method provided by gettext_i18n_rails - note the explicit + # setting of I18n.locale, required due to the I18nProxy used in Rails 3 to trigger the + # lookup_context and expire the template cache def set_gettext_locale if AlaveteliConfiguration::include_default_locale_in_urls == false params_locale = params[:locale] ? params[:locale] : I18n.default_locale @@ -63,7 +66,7 @@ class ApplicationController < ActionController::Base requested_locale = params_locale || session[:locale] || cookies[:locale] || I18n.default_locale end requested_locale = FastGettext.best_locale_in(requested_locale) - session[:locale] = FastGettext.set_locale(requested_locale) + session[:locale] = I18n.locale = FastGettext.set_locale(requested_locale) if !@user.nil? if @user.locale != requested_locale @user.locale = session[:locale] diff --git a/app/views/general/blog.html.erb b/app/views/general/blog.html.erb index 7146aab5d..ef587421e 100644 --- a/app/views/general/blog.html.erb +++ b/app/views/general/blog.html.erb @@ -23,7 +23,7 @@ <% @blog_items.each do |item| %> <div class="blog_post"> <h2 id="<%= Time.parse(item['pubDate'][0]).to_i %>"><a href="<%=item['link'][0]%>"><%=h item['title'][0] %></a></h2> - <p class="subtitle"><%= _("Posted on {{date}} by {{author}}", :date=>simple_date(Time.parse(item['pubDate'][0])), :author=>item['creator'][0]) %></p> + <p class="subtitle"><%= _("Posted on {{date}} by {{author}}", :date=>simple_date(Time.parse(item['pubDate'][0])), :author=> item['creator'] ? item['creator'][0] : item['author'][0]) %></p> <div> <% if item['encoded'] %> <%= raw item['encoded'][0] %> |