diff --git a/app/controllers/skins_controller.rb b/app/controllers/skins_controller.rb index 4adef9bdff..7763d58fa1 100644 --- a/app/controllers/skins_controller.rb +++ b/app/controllers/skins_controller.rb @@ -140,10 +140,10 @@ def preview def set if @skin.cached? - flash[:notice] = ts("The skin %{title} has been set. This will last for your current session.", title: @skin.title) + flash[:notice] = t(".success_html", skin_title: @skin.title, skin_page_link: helpers.link_to(t(".skin_page", skin_title: @skin.title), skin_path(@skin))) session[:site_skin] = @skin.id else - flash[:error] = ts("Sorry, but only certain skins can be used this way (for performance reasons). Please drop a support request if you'd like %{title} to be added!", title: @skin.title) + flash[:error] = t(".failure", skin_title: @skin.title) end redirect_back_or_to @skin end diff --git a/config/locales/controllers/en.yml b/config/locales/controllers/en.yml index e119853665..824f6bd3ec 100644 --- a/config/locales/controllers/en.yml +++ b/config/locales/controllers/en.yml @@ -314,6 +314,10 @@ en: index: public_site_page_title: Public Site Skins public_work_page_title: Public Work Skins + set: + failure: Sorry, but only certain skins can be used this way (for performance reasons). Please drop a support request if you'd like %{skin_title} to be added! + skin_page: "%{skin_title} skin page" + success_html: You're now using the %{skin_title} skin. This will last for 2 weeks even if you close your browser. If you'd like to keep it longer, go to the %{skin_page_link} and select the "Use" button at the bottom of the page. stats: index: page_title: "%{username} - Stats" diff --git a/features/other_b/skin_public.feature b/features/other_b/skin_public.feature index 98b274a99f..8033bd9cf9 100644 --- a/features/other_b/skin_public.feature +++ b/features/other_b/skin_public.feature @@ -14,7 +14,7 @@ Feature: Public skins And the skin "public skin" is in the chooser When I am logged in as "skinner" And I press "public skin" - Then I should see "The skin public skin has been set. This will last for your current session." + Then I should see "You're now using the public skin skin. This will last for 2 weeks" And the page should have the cached skin "public skin" When I press "Default" Then I should see "You are now using the default site skin again!" diff --git a/spec/controllers/skins_controller_spec.rb b/spec/controllers/skins_controller_spec.rb index b798c1c906..82d5b1c943 100644 --- a/spec/controllers/skins_controller_spec.rb +++ b/spec/controllers/skins_controller_spec.rb @@ -576,7 +576,7 @@ shared_examples "user can set it" do it "redirects with success notice" do post :set, params: { id: skin.id } - it_redirects_to_with_notice(skin_path(skin), "The skin Cached Public Skin has been set. This will last for your current session.") + it_redirects_to_with_notice(skin_path(skin), "You're now using the #{skin.title} skin. This will last for 2 weeks even if you close your browser. If you'd like to keep it longer, go to the #{skin.title} skin page and select the \"Use\" button at the bottom of the page.") end end