From f7dee7a375548cc5c74e75f56970743a18d4f360 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt <sean@lbry.io> Date: Mon, 29 Mar 2021 09:48:14 -0400 Subject: [PATCH] update strings --- component/email.jsx | 23 +++++++++----------- i18n.js | 51 +++++++++++++++++++++++++++++++++++++++++++++ pages/index.js | 36 ++++++++++++++------------------ 3 files changed, 77 insertions(+), 33 deletions(-) diff --git a/component/email.jsx b/component/email.jsx index c3bb5d9..f6ce442 100644 --- a/component/email.jsx +++ b/component/email.jsx @@ -1,6 +1,7 @@ import React from 'react'; +import { m } from '../i18n'; -export function Email() { +export function Email({ i18n }) { const [email, setEmail] = React.useState(''); const [emailLoading, setEmailLoading] = React.useState(false); const [emailError, setEmailError] = React.useState(); @@ -40,12 +41,10 @@ export function Email() { return ( <div className="email"> - <h2 className="content__section-title">Stay Informed</h2> - <div className="email__subtitle"> - We will keep you up to date with the latest on this case. - </div> + <h2 className="content__section-title">{i18n(m.email_title)}</h2> + <div className="email__subtitle">{i18n(m.email_subtitle)}</div> - <label htmlFor="email">Email</label> + <label htmlFor="email">{i18n(m.email_input_label)}</label> <form className="email__group" onSubmit={handleEmailSubmit}> <input type="email" @@ -55,19 +54,17 @@ export function Email() { onChange={(e) => setEmail(e.target.value)} /> <button disabled={!email || emailLoading}> - {emailLoading ? 'Submitting' : 'Submit'} + {emailLoading + ? i18n(m.email_input_button_loading) + : i18n(m.email_input_button)} </button> </form> {emailSuccess && ( - <div className="email__success"> - Thank you! We will keep you in the loop. - </div> + <div className="email__success">{i18n(m.email_success)}</div> )} {emailError && ( - <div className="email__success"> - Sorry, there was an error. Please try again. - </div> + <div className="email__success">{i18n(m.email_error)}</div> )} </div> ); diff --git a/i18n.js b/i18n.js index 29d8e87..fa4b4ea 100644 --- a/i18n.js +++ b/i18n.js @@ -8,6 +8,25 @@ export const m = { landing_action: 'landing_action', summary_title: 'summary_title', summary_subtitle: 'summary_subtitle', + p1_a: 'p1_a', + p1_b: 'p1_b', + p2_a: 'p2_a', + p2_b: 'p2_b', + share_story_title: 'share_story_title', + share_story_subtitle: 'share_story_subtitle', + petition_title: 'petition_title', + petition_subtitle: 'petition_subtitle', + petition_link: 'petition_link', + read_more_title: 'read_more_title', + read_more_subtitle: 'read_more_subtitle', + read_more_link: 'read_more_link', + email_title: 'email_title', + email_subtitle: 'email_subtitle', + email_input_label: 'email_input_label', + email_input_button: 'email_input_button', + email_input_button_loading: 'email_input_button_loading', + email_success: 'email_success', + email_error: 'email_error', }; const en = { @@ -17,12 +36,44 @@ const en = { go_home: 'Go Home', og_description: 'The SEC doesn’t understand blockchain. The claims made in SEC vs. LBRY would destroy the United States cryptocurrency industry.', + landing_subtitle: 'The SEC doesn’t understand blockchain. The claims made in SEC vs. LBRY would destroy the United States cryptocurrency industry.', landing_action: 'Help us educate the SEC', + summary_title: 'What’s the big deal?', summary_subtitle: 'The entire blockchain industry is at risk in the United States. Big tech and Wall St. would have more power and many people could lose their jobs!', + + p1_a: + 'The SEC is advancing an aggressive and disastrous new standard that would make almost all blockchain tokens securities.', + p1_b: + 'Classifying all actively-developed blockchain tokens as securities will be a bureaucratic nightmare for United States residents and businesses operating in the US.', + + p2_a: + 'Under this new standard, almost any token is a security, including the previously safe Ethereum. The nature of technology is that it is never "finished"!', + p2_b: + 'This change will make it much harder for startups to form new blockchain companies, cause massive job loss, and stunt the development of a critical new technology. All the while, big tech and Wall St. prosper!', + + share_story_title: 'Share this story', + share_story_subtitle: 'Post to social media to spread awareness.', + + petition_title: 'Sign the petition', + petition_subtitle: + 'Tell the SEC that cryptocurrency must remain legal and free.', + petition_link: 'Add your signature', + + read_more_title: 'Read more', + read_more_subtitle: 'Read our case guide and FAQ', + read_more_link: 'here', + + email_title: 'Stay Informed', + email_subtitle: 'We will keep you up to date with the latest on this case.', + email_input_label: 'Email', + email_input_button: 'Submit', + email_input_button_loading: 'Submitting', + email_success: 'Thank you! We will keep you in the loop.', + email_error: 'Sorry, there was an error. Please try again.', }; const es = {}; diff --git a/pages/index.js b/pages/index.js index 12e8fa3..641463a 100644 --- a/pages/index.js +++ b/pages/index.js @@ -64,13 +64,10 @@ export default function Home() { <div className="content__section"> <p> - The SEC is advancing an aggressive and disastrous new standard - that would make almost all blockchain tokens securities. + {__(m.p1_a)} <br /> <br /> - Classifying all actively-developed blockchain tokens as securities will be a - bureaucratic nightmare for United States residents and businesses - operating in the US. + {__(m.p1_b)} </p> <div className="content__img content__img--question"> @@ -92,22 +89,19 @@ export default function Home() { </div> <p> - Under this new standard, almost any token is a security, including - the previously safe Ethereum. The nature of technology is that it is never "finished"! + {__(m.p2_a)} <br /> <br /> - This change will make it much harder for startups to form new - blockchain companies, cause massive job loss, and stunt the - development of a critical new technology. All the while, big tech - and Wall St. prosper! + {__(m.p2_b)} </p> </div> <h2 className="content__section-title" id="share"> - Share this story + {__(m.share_story_title)} </h2> <div className="content__subtitle"> - Post to social media to spread awareness. + {__(m.share_story_subtitle)} + <a href="https://twitter.com/intent/tweet?text=LBRY%20and%20cryptocurrencies%20are%20useful%20technologies%20that%20must%20remain%20legal%20and%20free%20%23HelpLBRYSaveCrypto%0A%0Awww.helplbrysavecrypto.com" className="link" @@ -123,12 +117,13 @@ export default function Home() { <div className="content"> <h2 className="content__section-title" id="petition"> - Sign the petition + {__(m.petition_title)} </h2> <div className="content__subtitle"> - Tell the SEC that cryptocurrency must remain legal and free.{' '} + {__(m.petition_subtitle)} + <a className="link" href="https://www.change.org/p/28064277"> - Add your signature + {__(m.petition_link)} </a> . </div> @@ -136,18 +131,19 @@ export default function Home() { <div className="content"> <h2 className="content__section-title" id="petition"> - Read more + {__(m.read_more_title)} </h2> <div className="content__subtitle"> - Read our case guide and FAQ{' '} + {__(m.read_more_subtitle)} + <a className="link" href="/faq"> - here + {__(m.read_more_link)} </a> . </div> </div> - <Email /> + <Email i18n={__} /> <div className="content"> <h2 className="content__section-title">Try LBRY</h2>