From 34d919179a1a8ded5f16bfcb63771d3f5af64f8e Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 30 Dec 2012 02:13:58 -0500 Subject: [PATCH] i18n for broken_image_reports#new --- app/helpers/application_helper.rb | 4 ++++ app/helpers/broken_image_reports_helper.rb | 9 ++++++++ app/views/broken_image_reports/new.html.haml | 23 +++++--------------- config/locales/en-meep.yml | 14 ++++++++++++ config/locales/en.yml | 15 +++++++++++++ 5 files changed, 48 insertions(+), 17 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 411fe7e1..80205215 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -153,6 +153,10 @@ module ApplicationHelper def signed_in_meta_tag %().html_safe end + + def labeled_time_ago_in_words(time) + content_tag :abbr, time_ago_in_words(time), :title => time + end def title(value) content_for :title, value diff --git a/app/helpers/broken_image_reports_helper.rb b/app/helpers/broken_image_reports_helper.rb index a0337f99..3c52fe26 100644 --- a/app/helpers/broken_image_reports_helper.rb +++ b/app/helpers/broken_image_reports_helper.rb @@ -1,2 +1,11 @@ module BrokenImageReportsHelper + def format_converted_at(converted_at) + translate 'broken_image_reports.new.converted_at_html', + :converted_at_ago => labeled_time_ago_in_words(converted_at) + end + + def format_reported_at(reported_at) + translate 'broken_image_reports.new.reported_at_html', + :reported_at_ago => labeled_time_ago_in_words(reported_at) + end end diff --git a/app/views/broken_image_reports/new.html.haml b/app/views/broken_image_reports/new.html.haml index 42205509..39378815 100644 --- a/app/views/broken_image_reports/new.html.haml +++ b/app/views/broken_image_reports/new.html.haml @@ -1,13 +1,8 @@ -- title 'Report broken image' +- title t('.title') -%p - Thanks for helping us find broken image! Sometimes the converters don't get - things quite right, and sometimes that can be fixed by just trying the - conversion again. If reconversion doesn't seem to solve the issue, consider - sending us a bug report at #{mail_to 'webmaster@openneo.net'}. Thanks! +%p= t '.explanation_html', :contact_link => mail_to(contact_email) -%p - Which of these images looked broken? We'll put it in line for reconversion. +%p= t '.call_to_action' %ul#report-assets - @swf_assets.each do |swf_asset| @@ -17,16 +12,10 @@ = form_tag(:action => :create) do = hidden_field_tag 'swf_asset_remote_id', swf_asset.remote_id = hidden_field_tag 'swf_asset_type', swf_asset.type - = submit_tag 'Report as broken' + = submit_tag t('.submit') - if swf_asset.converted_at? - %span.converted-at - Converted - = time_ago_in_words swf_asset.converted_at - ago + %span.converted-at= format_converted_at(swf_asset.converted_at) - else - %span.reported-broken-at - Reported - = time_ago_in_words swf_asset.reported_broken_at - ago + %span.reported-broken-at= format_reported_at(swf_asset.reported_broken_at) diff --git a/config/locales/en-meep.yml b/config/locales/en-meep.yml index 9865b526..4b94559c 100644 --- a/config/locales/en-meep.yml +++ b/config/locales/en-meep.yml @@ -30,6 +30,20 @@ en-meep: Images © 2000–%{year} Neopets, Inc. All Rights Reserved. Used With Permission. Meep. + broken_image_reports: + new: + title: Meep broken image + explanation_html: + Thanks for helping us find broken meeps! Sometimes the meepits don't + get things quite right, and sometimes that can be meeped by just + meeping the conversion again. If reconversion doesn't seem to meep the + meep, consider sending us a meep at %{contact_link}. Meep! + call_to_action: + Which of these meeps looked meeped? We'll put it in line for remeeping. + submit: Meep as broken + converted_at_html: Conveeped %{converted_at_ago} ago + reported_at_html: Repeeped %{reported_at_ago} ago + outfits: new: tagline: Meeps made meepy! diff --git a/config/locales/en.yml b/config/locales/en.yml index 0e22e668..4e2a421f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,6 +30,21 @@ en: Images © 2000–%{year} Neopets, Inc. All Rights Reserved. Used With Permission + broken_image_reports: + new: + title: Report broken image + explanation_html: + Thanks for helping us find broken images! Sometimes the converters + don't get things quite right, and sometimes that can be fixed by just + trying the conversion again. If reconversion doesn't seem to solve the + issue, consider sending us a bug report at %{contact_link}. Thanks! + call_to_action: + Which of these images looked broken? + We'll put it in line for reconversion. + submit: Report as broken + converted_at_html: Converted %{converted_at_ago} ago + reported_at_html: Reported %{reported_at_ago} ago + outfits: new: tagline: Neopets wearables made easy!