diff --git a/app/controllers/public/home_controller.rb b/app/controllers/public/home_controller.rb index eb58dd9..3d37923 100644 --- a/app/controllers/public/home_controller.rb +++ b/app/controllers/public/home_controller.rb @@ -4,7 +4,7 @@ class HomeController < PublicController @has_news = false if environment.enabled?('use_portal_community') && environment.portal_community @has_news = true - @news_cache_key = environment.portal_news_cache_key + @news_cache_key = environment.portal_news_cache_key(FastGettext.locale) if !read_fragment(@news_cache_key) portal_community = environment.portal_community @highlighted_news = portal_community.news(2, true) diff --git a/app/models/environment.rb b/app/models/environment.rb index cdbc132..00b32ac 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -696,8 +696,8 @@ class Environment < ActiveRecord::Base settings[:portal_folders] = folders ? folders.map(&:id) : nil end - def portal_news_cache_key - "home-page-news/#{cache_key}" + def portal_news_cache_key(language='en') + "home-page-news/#{cache_key}-#{language}" end def notification_emails diff --git a/app/sweepers/article_sweeper.rb b/app/sweepers/article_sweeper.rb index f879ece..a984b7d 100644 --- a/app/sweepers/article_sweeper.rb +++ b/app/sweepers/article_sweeper.rb @@ -20,7 +20,9 @@ protected BlockSweeper.expire_blocks(blocks) env = article.profile.environment if env && (env.portal_community == article.profile) - expire_fragment(env.portal_news_cache_key) + Noosfero.locales.keys.each do |locale| + expire_fragment(env.portal_news_cache_key(locale)) + end end end -- libgit2 0.21.2