From c32425bc14d403eaf8553c61095faa553bdda170 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 30 Dec 2012 17:07:29 -0500 Subject: [PATCH] i18n for neopets_pages#new --- app/models/closet_page.rb | 2 +- app/models/safety_deposit_page.rb | 2 +- app/views/neopets_pages/new.html.haml | 107 +++++++++++++++----------- config/locales/en-meep.yml | 74 ++++++++++++++++++ config/locales/en.yml | 74 ++++++++++++++++++ 5 files changed, 210 insertions(+), 49 deletions(-) diff --git a/app/models/closet_page.rb b/app/models/closet_page.rb index f58a466f..08e9ba99 100644 --- a/app/models/closet_page.rb +++ b/app/models/closet_page.rb @@ -27,7 +27,7 @@ class ClosetPage end def name - 'closet' + I18n.translate('neopets_pages.names.closet') end def persisted? diff --git a/app/models/safety_deposit_page.rb b/app/models/safety_deposit_page.rb index 09619fdf..ccf16526 100644 --- a/app/models/safety_deposit_page.rb +++ b/app/models/safety_deposit_page.rb @@ -10,7 +10,7 @@ class SafetyDepositPage < ClosetPage } def name - 'SDB' + I18n.translate('neopets_pages.names.safety_deposit') end def url diff --git a/app/views/neopets_pages/new.html.haml b/app/views/neopets_pages/new.html.haml index 2850f517..d375738f 100644 --- a/app/views/neopets_pages/new.html.haml +++ b/app/views/neopets_pages/new.html.haml @@ -1,57 +1,70 @@ -- title "Import from #{@neopets_page.name}, Page #{@neopets_page.index}" +- title t('.title', :name => @neopets_page.name, :index => @neopets_page.index) - content_for :before_flashes do - = link_to 'Back to Your Items', user_closet_hangers_path(current_user), :id => 'back-to-items' + = link_to t('.your_items_link'), user_closet_hangers_path(current_user), :id => 'back-to-items' = form_for @neopets_page, :html => {:id => 'closet-page-form'} do |f| = f.hidden_field :index #closet-page-frame-wrapper %span - %strong Page #{@neopets_page.index} - of your #{@neopets_page.name} + %strong + = t '.frame_header', :name => @neopets_page.name, + :index => @neopets_page.index %iframe#closet-page-frame{:src => @neopets_page.url} #closet-page-source - = f.label :source, "Paste source code below" + = f.label :source, t('.source_header') = f.text_area :source - = f.submit 'Import items' - -:markdown - **Welcome to the bulk #{@neopets_page.name} importer!** We're going to make it as - easy as possible to import your Neopets.com #{@neopets_page.name} data into your Dress to - Impress items list. Here's how it works. - - 1. Check the framed Neopets.com window on the left, pointing to - [page #{@neopets_page.index} of your #{@neopets_page.name}][cp]. - * **Confirm that you're logged in.** If you're logged into - Neopets, but the above frame says that you're not, try enabling - "third-party cookies" in your browser. (Most have that on by default.) - * **If you haven't logged in, #{link_to_neopets_login "do so in another window"}.** - It's never a good idea to log in inside of a frame, unless you're a - web programmer pro who can check that the frame does, in fact, point - to Neopets.com. To be safe, - #{link_to_neopets_login "pull up another window, check the URL, and log in safely"}. - * **Confirm that the page is, in fact, your #{@neopets_page.name}.** Similarly, don't - just trust a website when they tell you to copy-paste the source code - of another site. Instead, check that the page is what it is supposed to - be and does not contain any information you didn't mean to give out. - - 2. View the frame's source code. - * **In Google Chrome,** right-click the frame and choose **View Frame Source**. - * **In Firefox,** right-click the frame, choose **This Frame**, then **View Frame Source**. - * In other browsers, right-click, and look for something similar. If you're - still having trouble, try - #{link_to "viewing the page in a new window", @neopets_page.url, :target => "_blank"}, - right-clicking, and choosing View Source. - - 3. Highlight the entire source code, and copy-paste it into the box on the right. - * Some nifty shortcuts: Ctrl-A to select all the text, Ctrl-C to copy it, - Ctrl-V to paste it in. - - 4. Submit! - * We'll analyze the code you sent us, grab exclusively the identity and - quantity of items in your #{@neopets_page.name}, and add that to your Dress to Impress - items list. I promise it's all safe, but, if you're concerned, find a - programmer buddy and [check out the source code to be sure][source]. - - [cp]: #{@neopets_page.url} - [source]: http://github.com/matchu/openneo-impress-rails + = f.submit t('.submit') +- localized_cache :action_suffix => 'explanation' do + %p + = t '.help.welcome', :name => @neopets_page.name + = t '.help.intro', :name => @neopets_page.name + + %ol + %li + = t '.help.check_frame.header_html', + :page_link => link_to(t('.help.check_frame.page_link_content', + :name => @neopets_page.name, + :index => @neopets_page.index), + @neopets_page.url) + %ul + %li + %strong= t '.help.check_frame.check_login.summary' + = t '.help.check_frame.check_login.details' + %li + %strong + = t '.help.check_frame.login.summary_html', + :login_link => link_to_neopets_login(t('.help.check_frame.login.summary_login_link_content')) + = t '.help.check_frame.login.details_html', + :login_link => link_to_neopets_login(t('.help.check_frame.login.details_login_link_content')) + %li + %strong + = t '.help.check_frame.check_content.summary', + :name => @neopets_page.name + = t '.help.check_frame.check_content.details' + + %li + = t '.help.view_source.header' + %ul + %li + = t '.help.view_source.chrome_html' + %li + = t '.help.view_source.firefox_html' + %li + = t '.help.view_source.other_html' + %li + = t '.help.view_source.troubleshooting_html', + :page_link => link_to(t('.help.view_source.troubleshooting_page_link_content'), + @neopets_page.url) + + %li + = t '.help.copy_source.header' + %ul + %li + = t '.help.copy_source.shortcuts' + + %li + = t '.help.submit.header' + %ul + %li + = t '.help.submit.description', :name => @neopets_page.name diff --git a/config/locales/en-meep.yml b/config/locales/en-meep.yml index 1e1bce72..468cd4d8 100644 --- a/config/locales/en-meep.yml +++ b/config/locales/en-meep.yml @@ -144,6 +144,80 @@ en-meep: we'll meep our datameep instantly. Meep! swf_assets_not_found_modeling_link_content: meep it for us + neopets_pages: + names: + closet: meepit + safety_deposit: safety demeepit + + new: + title: Meeport from %{name}, Page %{index} + your_items_link: Back to Your Meeps + frame_header: Meep %{index} of your %{name} + source_header: Meep source code below + submit: Meep items + help: + welcome: Welcome to the bulk %{name} meeporter! + intro: + We're going to meep it as easy as possible to meeport your + Neopets.com %{name} data into your Dress to Impress meepit list. + Here's how it meeps. + check_frame: + header_html: + Check the framed Neopets.com meep on the left, + meeping to %{page_link}. + page_link_content: + meep %{index} of your %{name} + check_login: + summary: Confirm that you're meeped in. + details: + If you're meeped into Neopets, but the above frame says that + you're not, try enabling "third-party cookies" in your browser. + (Most have meeped on by default.) + login: + summary_html: If you haven't meeped in, %{login_link}. + summary_login_link_content: do so in another meepit + details_html: + It's never a good idea to meep in inside of a frame, unless + you're a web programmer pro who can meep that the frame does, in + fact, meep to Neopets.com. To be safe, %{login_link}. + details_login_link_content: + meep up another window, meep the URL, and meep in safely + check_content: + summary: Meep that the page is, in fact, your %{name}. + details: + Don't just meep a website when they tell you to meepy-paste the + source code of another site. Instead, check that the meep is what + it is supposed to be and doesn't meep any private information. + view_source: + header: Meep the frame's source code. + chrome_html: + In Google Chrome, right-meep the frame and choose + View Frame Source. + firefox_html: + In Firefox, right-meep the frame, choose + This Frame, then View Frame + Source. + other_html: + In other meepits, right-meep and look for something similar. + troubleshooting_html: + If you're still having trouble, try %{page_link}, right-meeping, + and meeping View Source. + troubleshooting_page_link_content: meeping the page in a new window + copy_source: + header: + Meeplight the entire source code, + and meepy-paste it into the box on the right. + shortcuts: + "Some meepy shortcuts: Ctrl-A to select all the text, Ctrl-C to + copy it, Ctrl-V to paste it in." + submit: + header: Submeep! + description: + We'll analyze the meep you sent us, grab exclusively the identity + and quantity of meepits in your %{name}, and add that to your Dress + to Impress meepit list. I meep that it's all safe, but, if you're + concerned, find a meepit and meep out the source code to be sure. + neopets_users: new: title: Meemport from pets diff --git a/config/locales/en.yml b/config/locales/en.yml index 995d5cfa..1394679b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -146,6 +146,80 @@ en: we'll update our database instantly. Thanks! swf_assets_not_found_modeling_link_content: model it for us + neopets_pages: + names: + closet: closet + safety_deposit: safety deposit + new: + title: Import from %{name}, Page %{index} + your_items_link: Back to Your Items + frame_header: Page %{index} of your %{name} + source_header: Paste source code below + submit: Import items + help: + welcome: Welcome to the bulk %{name} importer! + intro: + We're going to make it as easy as possible to import your Neopets.com + %{name} data into your Dress to Impress items list. Here's how it + works. + check_frame: + header_html: + Check the framed Neopets.com window on the left, + pointing to %{page_link}. + page_link_content: + page %{index} of your %{name} + check_login: + summary: Confirm that you're logged in. + details: + If you're logged into Neopets, but the above frame says that + you're not, try enabling "third-party cookies" in your browser. + (Most have that on by default.) + login: + summary_html: If you haven't logged in, %{login_link}. + summary_login_link_content: do so in another window + details_html: + It's never a good idea to log in inside of a frame, unless you're + a web programmer pro who can check that the frame does, in fact, + point to Neopets.com. To be safe, %{login_link}. + details_login_link_content: + pull up another window, check the URL, and log in safely + check_content: + summary: Confirm that the page is, in fact, your %{name}. + details: + Don't just trust a website when they tell you to copy-paste the + source code of another site. Instead, check that the page is what + it is supposed to be and doesn't contain any private information. + view_source: + header: View the frame's source code. + chrome_html: + In Google Chrome, right-click the frame and choose + View Frame Source. + firefox_html: + In Firefox, right-click the frame, choose + This Frame, then View Frame + Source. + other_html: + In other browsers, right-click and look for something similar. + troubleshooting_html: + If you're still having trouble, try %{page_link}, right-clicking, + and choosing View Source. + troubleshooting_page_link_content: opening the page in a new window + copy_source: + header: + Highlight the entire source code, + and copy-paste it into the box on the right. + shortcuts: + "Some nifty shortcuts: Ctrl-A to select all the text, Ctrl-C to + copy it, Ctrl-V to paste it in." + submit: + header: Submit! + description: + We'll analyze the code you sent us, grab exclusively the identity + and quantity of items in your %{name}, and add that to your Dress + to Impress items list. I promise it's all safe, but, if you're + concerned, find a programmer buddy and check out the source code to + be sure. + neopets_users: new: title: Import from pets