From 7f2070e78e979f38e9ebfc4b49fc0965a8c76a3c Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 8 Jan 2013 19:23:22 -0600 Subject: [PATCH] refactor userbar contributions to use twl --- app/helpers/application_helper.rb | 9 +++------ config/locales/en-meep.yml | 5 +++-- config/locales/en.yml | 5 +++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 460ca226..87b4d1a2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -195,12 +195,9 @@ module ApplicationHelper alias_method :twl, :translate_with_links def userbar_contributions_summary(user) - contributions_link_content = translate('.userbar.contributions_link_content', - :user_points => user.points) - contributions_link = link_to(contributions_link_content, - user_contributions_path(user)) - translate '.userbar.contributions_summary_html', - :contributions_link => contributions_link + translate_with_links '.userbar.contributions_summary', + :contributions_link_url => user_contributions_path(user), + :user_points => user.points end end diff --git a/config/locales/en-meep.yml b/config/locales/en-meep.yml index a98d516a..62c87e4d 100644 --- a/config/locales/en-meep.yml +++ b/config/locales/en-meep.yml @@ -20,8 +20,9 @@ en-meep: userbar: greeting: Meep, %{user_name}! - contributions_summary_html: You have %{contributions_link}. - contributions_link_content: "%{user_points} meeps" + contributions_summary: + main_html: You have %{contributions_link}. + contributions_link_content: "%{user_points} meeps" items: Iteeps outfits: Outfeeps settings: Setteeps diff --git a/config/locales/en.yml b/config/locales/en.yml index 3204d6fe..85b8514f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -20,8 +20,9 @@ en: userbar: greeting: Hey, %{user_name}! - contributions_summary_html: You have %{contributions_link}. - contributions_link_content: "%{user_points} points" + contributions_summary: + main_html: You have %{contributions_link}. + contributions_link_content: "%{user_points} points" items: Items outfits: Outfits settings: Settings