From b69793c008aabd043371a651f14f04062eb1bee2 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 30 Dec 2012 02:57:23 -0500 Subject: [PATCH] i18n for contributions#index --- app/stylesheets/contributions/_index.sass | 11 ++++---- .../contributions/_contribution.html.haml | 15 +++++------ app/views/contributions/index.html.haml | 16 ++++++------ app/views/users/top_contributors.html.haml | 2 +- config/locales/en-meep.yml | 25 +++++++++++++------ config/locales/en.yml | 25 +++++++++++++------ public/stylesheets/compiled/screen.css | 8 +++--- 7 files changed, 59 insertions(+), 43 deletions(-) diff --git a/app/stylesheets/contributions/_index.sass b/app/stylesheets/contributions/_index.sass index 6319c5e6..020bc186 100644 --- a/app/stylesheets/contributions/_index.sass +++ b/app/stylesheets/contributions/_index.sass @@ -30,9 +30,8 @@ body.contributions-index top: 0 width: 80px z-index: 2 - span - &.username, &.contributed-name - font-weight: bold - &.time-ago - display: block - font-size: 75% + .username, .contributed-name + font-weight: bold + .time-ago + display: block + font-size: 75% diff --git a/app/views/contributions/_contribution.html.haml b/app/views/contributions/_contribution.html.haml index 59873b8b..3e37c748 100644 --- a/app/views/contributions/_contribution.html.haml +++ b/app/views/contributions/_contribution.html.haml @@ -1,10 +1,11 @@ - contributed = contribution.contributed = content_tag_for :li, contribution do %span.point-value= contribution.point_value - %span.username - = link_to contribution.user.name, user_contributions_path(contribution.user) - showed us - = contributed_description contributed - %span.time-ago{:title => contribution.created_at.to_s} - = time_ago_in_words(contribution.created_at) - ago + = t 'contributions.contribution.description_html', + :user_link => link_to(contribution.user.name, + user_contributions_path(contribution.user), + :class => 'username'), + :contributed_description => contributed_description(contributed) + .time-ago + = t 'contributions.contribution.created_at_html', + :created_at_ago => labeled_time_ago_in_words(contribution.created_at) diff --git a/app/views/contributions/index.html.haml b/app/views/contributions/index.html.haml index 7de1fd3a..b236deb8 100644 --- a/app/views/contributions/index.html.haml +++ b/app/views/contributions/index.html.haml @@ -1,19 +1,17 @@ -- title 'Recent Contributions' +- title t('.title') - if @user - canonical_path user_contributions_path(@user) %ul.buttons - if @user - %li= link_to 'Recent Contributions', contributions_path, :class => 'button' - %li= link_to 'Top Contributors', top_contributors_path, :class => 'button' + %li= link_to t('.title'), contributions_path, :class => 'button' + %li + = link_to t('users.top_contributors.title'), top_contributors_path, + :class => 'button' - if @user - %p - = @user.name - currently has - = @user.points - points + %p= t('.user_summary', :user_name => @user.name, :user_points => @user.points) - if @contributions.empty? - %p No contributions to see here! + %p= t('.no_contributions') - else = will_paginate @contributions %ul.contributions= render @contributions diff --git a/app/views/users/top_contributors.html.haml b/app/views/users/top_contributors.html.haml index def20f2e..c4bcb33f 100644 --- a/app/views/users/top_contributors.html.haml +++ b/app/views/users/top_contributors.html.haml @@ -1,4 +1,4 @@ -- title t('.header') +- title t('.title') = will_paginate @users %table#top-contributors %thead diff --git a/config/locales/en-meep.yml b/config/locales/en-meep.yml index 94421d3c..dc53737c 100644 --- a/config/locales/en-meep.yml +++ b/config/locales/en-meep.yml @@ -47,7 +47,23 @@ en-meep: submit: Meep as broken converted_at_html: Conveeped %{converted_at_ago} ago reported_at_html: Repeeped %{reported_at_ago} ago + + contributions: + contributed_description: + item_suffix: for the first meep + swf_asset_suffix: on a new body meep + pet_type_suffix: for the first meep + pet_state_prefix: a new meep for + contribution: + description_html: "%{user_link} meeped us %{contributed_description}" + created_at_html: "%{created_at_ago} ameep" + + index: + title: Recent Contribeeptions + user_summary: "%{user_name} currently has %{user_points} meeps" + no_contributions: There are no contribeeptions here. + items: index: title_with_query: Searching Infinite Meepit for "%{query}" @@ -116,16 +132,9 @@ en-meep: clone: Meep a copy creation_summary_html: Meeped by %{user_link}, %{created_at_ago} ago - contributions: - contributed_description: - item_suffix: "for the first meep" - swf_asset_suffix: "on a new body meep" - pet_type_suffix: "for the first meep" - pet_state_prefix: "a new meep for" - users: top_contributors: - header: Top Conmeeputors + title: Top Conmeeputors rank: Reep user: Meepit points: Peeps diff --git a/config/locales/en.yml b/config/locales/en.yml index d8e613a6..fac24ccf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -49,6 +49,22 @@ en: converted_at_html: Converted %{converted_at_ago} ago reported_at_html: Reported %{reported_at_ago} ago + contributions: + contributed_description: + item_suffix: for the first time + swf_asset_suffix: on a new body type + pet_type_suffix: for the first time + pet_state_prefix: a new pose for + + contribution: + description_html: "%{user_link} showed us %{contributed_description}" + created_at_html: "%{created_at_ago} ago" + + index: + title: Recent Contributions + user_summary: "%{user_name} currently has %{user_points} points" + no_contributions: There are no contributions here. + items: index: title_with_query: Searching Infinite Closet for "%{query}" @@ -118,16 +134,9 @@ en: clone: Edit a copy creation_summary_html: Created by %{user_link}, %{created_at_ago} ago - contributions: - contributed_description: - item_suffix: "for the first time" - swf_asset_suffix: "on a new body type" - pet_type_suffix: "for the first time" - pet_state_prefix: "a new pose for" - users: top_contributors: - header: Top Contributors + title: Top Contributors rank: Rank user: User points: Points diff --git a/public/stylesheets/compiled/screen.css b/public/stylesheets/compiled/screen.css index dee2bedc..6d9af8e0 100644 --- a/public/stylesheets/compiled/screen.css +++ b/public/stylesheets/compiled/screen.css @@ -1614,12 +1614,12 @@ body.contributions-index .contributions img { width: 80px; z-index: 2; } -/* line 34, ../../../app/stylesheets/contributions/_index.sass */ -body.contributions-index .contributions span.username, body.contributions-index .contributions span.contributed-name { +/* line 33, ../../../app/stylesheets/contributions/_index.sass */ +body.contributions-index .contributions .username, body.contributions-index .contributions .contributed-name { font-weight: bold; } -/* line 36, ../../../app/stylesheets/contributions/_index.sass */ -body.contributions-index .contributions span.time-ago { +/* line 35, ../../../app/stylesheets/contributions/_index.sass */ +body.contributions-index .contributions .time-ago { display: block; font-size: 75%; }