From 7d8513db3950f12dfc9c1a45708af32946a49f0e Mon Sep 17 00:00:00 2001 From: Shane Tomlinson <stomlinson@mozilla.com> Date: Thu, 12 Jul 2012 12:09:33 +0100 Subject: [PATCH] Starting the gettext process on the main site. --- resources/views/about.ejs | 26 ++++----- resources/views/authenticate_with_primary.ejs | 2 +- resources/views/forgot.ejs | 42 +++++++-------- resources/views/idp_auth_complete.ejs | 2 +- resources/views/index.ejs | 42 +++++++-------- resources/views/relay.ejs | 2 +- resources/views/signin.ejs | 34 ++++++------ resources/views/signup.ejs | 54 +++++++++---------- resources/views/unsupported_dialog.ejs | 9 ++-- 9 files changed, 102 insertions(+), 111 deletions(-) diff --git a/resources/views/about.ejs b/resources/views/about.ejs index 3c41de497..ec4b66f07 100644 --- a/resources/views/about.ejs +++ b/resources/views/about.ejs @@ -5,44 +5,44 @@ <div id="content" class="display_always"> <div class="about"> <section class="simple-signon"> - <h2 class="title">Simplified sign-on.</h2> + <h2 class="title"><%- gettext('Simplified sign-on.') %></h2> <article class="blurb"> <div class="info first"> - <h1>Persona replaces multiple passwords</h1> - <p>Sites such as <a href="http://crossword.thetimes.co.uk/" target="_blank">The Times Crossword</a>, <a href="http://current.openphoto.me/" target="_blank">OpenPhoto</a> and <a href="https://www.voo.st/" target="_blank">Voost</a> use Persona instead of usernames to sign you in.</p><p>This means you only need one password to sign in to many sites.</p> + <h1><%- gettext('Persona replaces multiple passwords') %></h1> + <p><%- gettext('Sites such as <a href="http://crossword.thetimes.co.uk/" target="_blank">The Times Crossword</a>, <a href="http://current.openphoto.me/" target="_blank">OpenPhoto</a> and <a href="https://www.voo.st/" target="_blank">Voost</a> use Persona instead of usernames to sign you in.') %></p><p><%- gettext('This means you only need one password to sign in to many sites.') %></p> </div> <div class="graphic"> - <img src="<%- cachify('/pages/i/one-password-graphic.png') %>" alt="One password to rule them all."> + <img src="<%- cachify('/pages/i/one-password-graphic.png') %>" alt="<%- gettext('One password to rule them all.') %>"> </div> </article> <article class="blurb flexible"> <div class="graphic first"> - <img src="<%- cachify('/pages/i/flexible-graphic.png') %>" alt="Use multiple email addresses"> + <img src="<%- cachify('/pages/i/flexible-graphic.png') %>" alt="<%- gettext('Use multiple email addresses') %>"> </div> <div class="info"> - <h1>Persona is flexible</h1> - <p>Within Persona, your identity is your email address. You can use as many email addresses as you want, but you still only need one password.</p> + <h1><%- gettext('Persona is flexible') %></h1> + <p><%- gettext('Within Persona, your identity is your email address. You can use as many email addresses as you want, but you still only need one password.') %></p> </div> </article> </section> <section class="privacy"> - <h2 class="title">Real privacy.</h2> + <h2 class="title"><%- gettext('Real privacy.') %></h2> <article class="blurb half first" style="min-height: 195px; "> - <h1>Persona is proudly non-profit for you</h1> - <p>Persona is developed by Mozilla, a not-for-profit company trusted throughout the Web community. Our goal is to create technologies that balance an open Web platform with people’s privacy.</p> + <h1><%- gettext('Persona is proudly non-profit for you') %></h1> + <p><%- gettext('Persona is developed by Mozilla, a not-for-profit company trusted throughout the Web community. Our goal is to create technologies that balance an open Web platform with people\’s privacy.') %></p> </article> <article class="blurb half"> - <h1>Persona preserves your privacy</h1> - <p>Persona does not track your activity around the Web. It creates a wall between signing you in and what you do once you’re there. The history of what sites you visit is stored only on your own computer.</p> + <h1><%- gettext('Persona preserves your privacy') %></h1> + <p><%- gettext('Persona does not track your activity around the Web. It creates a wall between signing you in and what you do once you\’re there. The history of what sites you visit is stored only on your own computer.') %></p> </article> </section> - <a href="https://developer.mozilla.org/en/BrowserID/Quick_Setup" class="developers" target="_blank"><img src="<%- cachify('/pages/i/developers-link.png') %>" alt="Persona for developers"><span>Implement Persona on your site </span>Developer guides and API documentation</a> + <a href="https://developer.mozilla.org/en/BrowserID/Quick_Setup" class="developers" target="_blank"><img src="<%- cachify('/pages/i/developers-link.png') %>" alt="<%- gettext('Persona for developers') %>"><span><%- gettext('Implement Persona on your site') %> </span><%- gettext('Developer guides and API documentation') %></a> </div><!-- #dashboard --> </div> diff --git a/resources/views/authenticate_with_primary.ejs b/resources/views/authenticate_with_primary.ejs index 45f8dab1d..69d5be5ec 100644 --- a/resources/views/authenticate_with_primary.ejs +++ b/resources/views/authenticate_with_primary.ejs @@ -5,7 +5,7 @@ <html> <head> <meta charset="utf-8"> - <title>Browser ID</title> + <title>Persona</title> <%- cachify_js('/production/authenticate_with_primary.js') %> </head> </html> diff --git a/resources/views/forgot.ejs b/resources/views/forgot.ejs index 705d14ead..59a0c5d59 100644 --- a/resources/views/forgot.ejs +++ b/resources/views/forgot.ejs @@ -6,70 +6,70 @@ <div id="vAlign"> <!-- XXX this form submits to nowhere --> <form id="signUpForm" class="cf authform" novalidate> - <h1>Forgot Password</h1> + <h1><%- gettext('Forgot Password') %></h1> <div class="notifications"> <div class="notification emailsent"> - <h2>Confirm your email address</h2> + <h2><%- gettext('Confirm your email address') %></h2> <p> - Check your email at <strong id="sentToEmail"></strong>. + <%- gettext('Check your email at <strong id="sentToEmail"></strong>.') %> </p> <p> - Click the link in the confirmation email. Your password will then be reset. + <%- gettext('Click the link in the confirmation email. Your password will then be reset.') %> </p> </div> </div> <ul class="inputs forminputs"> <li> - <label for="email">Email Address</label> - <input id="email" autofocus required placeholder="Your Email" type="email" autocapitalize="off" autocorrect="off" maxlength="254" /> + <label for="email"><%- gettext('Email Address') %></label> + <input id="email" autofocus required placeholder="<%- gettext('Your Email') %>" type="email" autocapitalize="off" autocorrect="off" maxlength="254" /> <div id="email_format" class="tooltip" for="email"> - This field must be an email address. + <%- gettext('This field must be an email address.') %> </div> <div id="email_required" class="tooltip" for="email"> - The email field is required. + <%- gettext('The email field is required.') %> </div> <div id="could_not_add" class="tooltip" for="email"> - We just sent an email to that address! If you really want to send another, wait a minute or two and try again. + <%- gettext('We just sent an email to that address! If you really want to send another, wait a minute or two and try again.') %> </div> <div id="not_registered" class="tooltip" for="email"> - Non existent user! + <%- gettext('Non existent user!') %> </div> </li> <li> - <label for="password">Password</label> - <input id="password" placeholder="Password" type="password" maxlength="80"> + <label for="password"><%- gettext('Password') %></label> + <input id="password" placeholder="<%- gettext('Password') %>" type="password" maxlength="80"> <div id="password_required" class="tooltip" for="password"> - Password is required. + <%- gettext('Password is required.') %> </div> <div class="tooltip" id="password_length" for="password"> - Password must be between 8 and 80 characters long. + <%- gettext('Password must be between 8 and 80 characters long.') %> </div> <div id="could_not_add" class="tooltip" for="password"> - We just sent an email to that address! If you really want to send another, wait a minute or two and try again. + <%- gettext('We just sent an email to that address! If you really want to send another, wait a minute or two and try again.') %> </div> </li> <li> - <label for="vpassword">Verify Password</label> - <input id="vpassword" placeholder="Verify Password" type="password" maxlength="80"> + <label for="vpassword"><%- gettext('Verify Password') %></label> + <input id="vpassword" placeholder="<%- gettext('Verify Password') %>" type="password" maxlength="80"> <div id="password_required" class="tooltip" for="vpassword"> - Verification password is required. + <%- gettext('Verification password is required.') %> </div> <div class="tooltip" id="passwords_no_match" for="vpassword"> - These passwords don't match! + <%- gettext('These passwords don\'t match!') %> </div> </li> @@ -77,9 +77,9 @@ </ul> <div class="submit cf forminputs"> - <button>Reset Password</button> + <button><%- gettext('Reset Password') %></button> <div class="remember cf"> - <a class="action" href="/signin">Know your password? Sign in.</a> + <a class="action" href="/signin"><%- gettext('Know your password? Sign in.') %></a> </div> </div> </form> diff --git a/resources/views/idp_auth_complete.ejs b/resources/views/idp_auth_complete.ejs index f7e568635..538a99157 100644 --- a/resources/views/idp_auth_complete.ejs +++ b/resources/views/idp_auth_complete.ejs @@ -3,7 +3,7 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <div id="vAlign" class="disply_always"> - This window will now close and account creation will continue. + <%- gettext('This window will now close and account creation will continue.') %> </div> <script type="text/javascript"> diff --git a/resources/views/index.ejs b/resources/views/index.ejs index 7eb8e2c35..b5cba8356 100644 --- a/resources/views/index.ejs +++ b/resources/views/index.ejs @@ -7,11 +7,11 @@ <div id="signUp"> <div id="card"><img src="<%- cachify('/pages/i/slit.png') %>"></div> - <h1 class="white headline-main">Connect with Mozilla Persona, the safest & easiest way to sign in.</h1> + <h1 class="white headline-main"><%- gettext('Connect with Mozilla Persona, the safest & easiest way to sign in.') %></h1> <p class="tour white"> - <a href="/about">Take the tour</a> + <a href="/about"><%- gettext('Take the tour') %></a> or - <a href="/signup" class="button create">Sign up →</a> + <a href="/signup" class="button create"><%- gettext('Sign up →') %></a> </p> </div> </div> @@ -20,25 +20,25 @@ <script type="text/html" id="templateUser"> <li class="identity cf" id="{{ email.replace('@', '_').replace('.', '_') }}"> <div class="email">{{ email }}</div> - <button class="delete">remove</button> + <button class="delete"><%- gettext('remove') %></button> </li> </script> <script type="text/html" id="templateManage"> <div id="content"> <div class="newsbanner" id="newuser"> - New to Mozilla Persona? <a href="/about">Learn more</a> + <%- gettext('New to Mozilla Persona? <a href="/about">Learn more</a>') %> </div> <div id="manage"> - <h1>Account Manager</h1> + <h1><%- gettext('Account Manager') %></h1> <section> <header class="buttonrow cf"> - <h2>Your Email Addresses</h2> + <h2><%- gettext('Your Email Addresses') %></h2> - <button class="edit">edit</button> - <button class="done">done</button> + <button class="edit"><%- gettext('edit') %></button> + <button class="done"><%- gettext('done') %></button> </header> <ul id="emailList"> @@ -47,32 +47,32 @@ <section id="edit_password"> <header class="buttonrow cf"> - <h2>Password</h2> + <h2><%- gettext('Password') %></h2> - <button class="edit">edit</button> - <button class="done">cancel</button> + <button class="edit"><%- gettext('edit') %></button> + <button class="done"><%- gettext('cancel') %></button> </header> <div class="showedit"> - <label for="old_password">Old Password</label> - <label for="new_password">New Password</label> + <label for="old_password"><%- gettext('Old Password') %></label> + <label for="new_password"><%- gettext('New Password') %></label> </div> <form id="edit_password_form" class="showedit"> <input type="password" id="old_password" name="old_password" maxlength="80"/> <input type="password" id="new_password" name="new_password" maxlength="80"/> - <button id="changePassword">done</button> + <button id="changePassword"><%- gettext('done') %></button> - <div class="tooltip" for="old_password" id="tooltipOldRequired">Old password is required.</div> - <div class="tooltip" for="old_password" id="tooltipInvalidPassword">Incorrect old password, password not updated.</div> - <div class="tooltip" for="new_password" id="tooltipNewRequired">New password is required.</div> - <div class="tooltip" for="new_password" id="tooltipPasswordsSame">Old and new passwords are the same.</div> - <div class="tooltip" for="new_password" id="tooltipPasswordLength">Password must be between 8 and 80 characters long.</div> + <div class="tooltip" for="old_password" id="tooltipOldRequired"><%- gettext('Old password is required.') %></div> + <div class="tooltip" for="old_password" id="tooltipInvalidPassword"><%- gettext('Incorrect old password, password not updated.') %></div> + <div class="tooltip" for="new_password" id="tooltipNewRequired"><%- gettext('New password is required.') %></div> + <div class="tooltip" for="new_password" id="tooltipPasswordsSame"><%- gettext('Old and new passwords are the same.') %></div> + <div class="tooltip" for="new_password" id="tooltipPasswordLength"><%- gettext('Password must be between 8 and 80 characters long.') %></div> </form> </section> - <p id="disclaimer">You may, at any time, <a href="#" id="cancelAccount" class="action">cancel your account</a></p> + <p id="disclaimer"><%- gettext('You may, at any time, <a href="#" id="cancelAccount" class="action">cancel your account</a>') %></p> </div> </div> diff --git a/resources/views/relay.ejs b/resources/views/relay.ejs index 4ee25e8a7..6487480da 100644 --- a/resources/views/relay.ejs +++ b/resources/views/relay.ejs @@ -5,7 +5,7 @@ <html> <head> <meta charset="utf-8"> - <title>Browser ID</title> + <title>Persona</title> <%- cachify_js('/production/relay.js') %> </head> </html> diff --git a/resources/views/signin.ejs b/resources/views/signin.ejs index d09e2a56e..683af56d6 100644 --- a/resources/views/signin.ejs +++ b/resources/views/signin.ejs @@ -6,64 +6,62 @@ <div id="vAlign"> <!-- XXX this form submits to nowhere --> <form id="signUpForm" class="cf authform" novalidate> - <h1>Sign In</h1> + <h1><%- gettext('Sign In') %></h1> <ul class="notifications"> <li class="notification" id="unknown_secondary"> - <strong id="unknown_email">Email</strong> is not registered. - Would you like to <a class="action" href="/signup">sign up</a> instead? + <%- gettext('<strong id="unknown_email">Email</strong> is not registered. Would you like to <a class="action" href="/signup">sign up</a> instead?') %> </li> </ul> <ul class="inputs"> <li> - <label for="email">Email Address</label> - <input id="email" autofocus placeholder="Your Email" type="email" autocapitalize="off" autocorrect="off" tabindex="1" maxlength="254" /> + <label for="email"><%- gettext('Email Address') %></label> + <input id="email" autofocus placeholder="<%- gettext('Your Email') %>" type="email" autocapitalize="off" autocorrect="off" tabindex="1" maxlength="254" /> <div id="email_format" class="tooltip" for="email"> - This field must be an email address. + <%- gettext('This field must be an email address.') %> </div> <div id="email_required" class="tooltip" for="email"> - The email field is required. + <%- gettext('The email field is required.') %> </div> </li> </ul> <ul class="inputs password_entry"> <li class="password_section"> - <a class="forgot right" href="/forgot" tabindex="4">forgot your password?</a> - <label for="password">Password</label> - <input id="password" placeholder="Your Password" type="password" tabindex="2" maxlength="80"> + <a class="forgot right" href="/forgot" tabindex="4"><%- gettext('forgot your password?') %></a> + <label for="password"><%- gettext('Password') %></label> + <input id="password" placeholder="<%- gettext('Your Password') %>" type="password" tabindex="2" maxlength="80"> <div id="password_required" class="tooltip" for="password"> - The password field is required. + <%- gettext('The password field is required.') %> </div> <div id="cannot_authenticate" class="tooltip" for="password"> - This email address and password do not match. + <%- gettext('This email address and password do not match.') %> </div> </li> </ul> <div class="submit cf forminputs"> - <button tabindex="5">Sign In</button> + <button tabindex="5"><%- gettext('Sign In') %></button> <div class="remember cf"> - <a class="action" href="/signup">New to Persona? Sign up today.</a> + <a class="action" href="/signup"><%- gettext('New to Persona? Sign up today.') %></a> </div> </div> <ul class="notifications"> <li class="notification" id="verify_primary"> <p> - To verify that you own <strong id="primary_email">address</strong>, you must - sign in with your provider. A new window will be opened. + <%- gettext('To verify that you own <strong id="primary_email">address</strong>, you must sign in with your provider. A new window will be opened.') %> </p> <p> - <button id="authWithPrimary">Verify</button> + <button id="authWithPrimary"><%- gettext('Verify') %></button> </p> </li> </ul> @@ -72,6 +70,6 @@ </div> <noscript> - We're sorry, Persona requires that Javascript is enabled. + <%- gettext('We\'re sorry, Persona requires that Javascript is enabled.') %> </noscript> diff --git a/resources/views/signup.ejs b/resources/views/signup.ejs index 8440816f1..75b94f14d 100644 --- a/resources/views/signup.ejs +++ b/resources/views/signup.ejs @@ -6,23 +6,22 @@ <div id="vAlign"> <!-- XXX this form submits to nowhere --> <form id="signUpForm" class="cf authform" novalidate> - <h1>Create Account</h1> + <h1><%- gettext('Create Account') %></h1> <ul class="notifications"> <li class="notification alreadyRegistered"> - <strong id="registeredEmail"></strong> is already registered. - Would you like to <a class="action" href="/signin">sign in</a> instead? + <%- gettext('<strong id="registeredEmail"></strong> is already registered. Would you like to <a class="action" href="/signin">sign in</a> instead?') %> </li> <li class="notification emailsent"> - <h2>Confirm your email address</h2> + <h2><%- gettext('Confirm your email address') %></h2> <p> - Check your email at <strong id="sentToEmail"></strong>. + <%- gettext('Check your email at <strong id="sentToEmail"></strong>.') %> </p> <p> - Click the link in the confirmation email. You'll then immediately be signed into Persona. + <%- gettext('Click the link in the confirmation email. You\'ll then immediately be signed into Persona.') %> </p> </li> @@ -30,49 +29,45 @@ <ul class="inputs forminputs"> <li> - <label for="email">Email Address</label> - <input id="email" autofocus placeholder="Your Email" type="email" autocapitalize="off" autocorrect="off" maxlength="254" /> + <label for="email"><%- gettext('Email Address') %></label> + <input id="email" autofocus placeholder="<%- gettext('Your Email') %>" type="email" autocapitalize="off" autocorrect="off" maxlength="254" /> <div id="email_format" class="tooltip" for="email"> - This field must be an email address. + <%- gettext('This field must be an email address.') %> </div> <div id="email_required" class="tooltip" for="email"> - The email field is required. + <%- gettext('The email field is required.') %> </div> <div id="could_not_add" class="tooltip" for="email"> - We just sent an email to that address! If you really want to send another, wait a minute or two and try again. + <%- gettext('We just sent an email to that address! If you really want to send another, wait a minute or two and try again.') %> </div> </li> <li class="password_entry"> - <label for="password">Password</label> - <input id="password" placeholder="Password" type="password" maxlength="80"> + <label for="password"><%- gettext('Password') %></label> + <input id="password" placeholder="<%- gettext('Password') %>" type="password" maxlength="80"> <div id="password_required" class="tooltip" for="password"> - Password is required. + <%- gettext('Password is required.') %> </div> <div class="tooltip" id="password_length" for="password"> - Password must be between 8 and 80 characters long. - </div> - - <div id="could_not_add" class="tooltip" for="password"> - We just sent an email to that address! If you really want to send another, wait a minute or two and try again. + <%- gettext('Password must be between 8 and 80 characters long.') %> </div> </li> <li class="password_entry"> - <label for="vpassword">Verify Password</label> - <input id="vpassword" placeholder="Verify Password" type="password" maxlength="80"> + <label for="vpassword"><%- gettext('Verify Password') %></label> + <input id="vpassword" placeholder="<%- gettext('Verify Password') %>" type="password" maxlength="80"> <div id="password_required" class="tooltip" for="vpassword"> - Verification password is required. + <%- gettext('Verification password is required.') %> </div> <div class="tooltip" id="passwords_no_match" for="vpassword"> - These passwords don't match! + <%- gettext('These passwords don\'t match!') %> </div> </li> @@ -80,8 +75,8 @@ <div class="submit cf forminputs"> <p class="cf"> - <button>Verify Email</button> - <a class="action remember" href="/signin" tabindex="2">Existing account? Sign in.</a> + <button><%- gettext('Verify Email') %></button> + <a class="action remember" href="/signin" tabindex="2"><%- gettext('Existing account? Sign in.') %></a> </p> <p class="tospp"> @@ -99,12 +94,11 @@ <!-- This has to go down here because of the button. Firefox clicks the first button in the form whenever the user hits enter in the form, whether the button is shown or not, and even if there is an input[type=submit]. Ghetto. --> <li class="notification" id="primary_verify"> <p> - To verify that you own <strong id="primary_email">address</strong>, you must - sign in with your provider. A new window will be opened. + <%- gettext('To verify that you own <strong id="primary_email">address</strong>, you must sign in with your provider. A new window will be opened.') %> </p> <p class="submit"> - <button id="authWithPrimary" tabindex="1">Verify</button> + <button id="authWithPrimary" tabindex="1"><%- gettext('Verify') %></button> </p> </li> </ul> @@ -113,7 +107,7 @@ </form> <div class="notification" id="congrats"> - <p>Thank you for signing up with <strong>Persona</strong>. You can now use your Persona account to <em>Sign In</em> or <em>Sign Up</em> to websites all across the web! + <p><%- gettext('Thank you for signing up with <strong>Persona</strong>. You can now use your Persona account to <em>Sign In</em> or <em>Sign Up</em> to websites all across the web!') %> </p> </div> @@ -121,7 +115,7 @@ </div> <noscript> - We're sorry, but to sign up for Persona, you must have Javascript enabled. + <%- gettext('We\'re sorry, Persona requires that Javascript is enabled.') %> </noscript> diff --git a/resources/views/unsupported_dialog.ejs b/resources/views/unsupported_dialog.ejs index 13d893660..01340c242 100644 --- a/resources/views/unsupported_dialog.ejs +++ b/resources/views/unsupported_dialog.ejs @@ -4,21 +4,20 @@ <section id="error" style="display: block" class="unsupported"> <h2> - We are sorry, but currently your browser is not supported. + <%- gettext('We are sorry, but currently your browser is not supported.') %> </h2> <a href="http://getfirefox.com" target="_blank"> - <img src="<%- cachify('/dialog/i/firefox_logo.png') %>" width="250" height="88" alt="Firefox logo" /> + <img src="<%- cachify('/dialog/i/firefox_logo.png') %>" width="250" height="88" alt="<%- gettext('Firefox logo') %>" /> </a> <p> - Persona works with <a href="http://getfirefox.com" target="_blank" title="Get Firefox">Firefox</a> + <%- gettext('Persona works with <a href="http://getfirefox.com" target="_blank" title="Get Firefox">Firefox</a>') %> </p> <p class="lighter"> - and other <a href="http://whatbrowser.org" target="_blank">modern browsers.</a> + <%- gettext('and other <a href="http://whatbrowser.org" target="_blank">modern browsers.</a>') %> </p> - </section> -- GitLab