Commits

Ben Bangert committed bdc2f3e

More i18n strings

Comments (0)

Files changed (7)

kai/controllers/accounts.py

                     redirect_to('home')
             
             # Valid e-mail token, remove it and log the user in
-            user.email_token = None
+            user.email_token = user.email_token_issue = None
             user.process_login()
             success_flash('Your email has been verified, and you have been'
                           ' logged into PylonsHQ')

kai/model/validators.py

         user = users[0]
         
         # Check to see if the user has recently asked for an email token
-        if user.email_token_issue:
-            diff = datetime.utcnow() - user.email_token_issue
+        if user.password_token_issue:
+            diff = datetime.utcnow() - user.password_token_issue
             if diff.days < 1 and diff.seconds < 3600:
                 raise formencode.Invalid(
                     "You've already requested a password recently.  Please " 

kai/templates/accounts/associate.mako

     from kai.model.forms import login_form
 %>
 <div class="yui-b content">
-    <h1>OpenID Association</h1>
+    <h1>${_('OpenID Association')}</h1>
     
-    <p>The OpenID URL you used (<b>${c.openid}</b>) was not found
+    <p>${_('''The OpenID URL you used (<b>%s</b>) was not found
         in our database. If you would like to associate this OpenID URL with
         an existing account so that you can use this OpenID URL to login with
-        in the future, proceed below.</p>
+        in the future, proceed below.''' % c.openid)}</p>
     
-    <p>If you would like to register with PylonsHQ instead,
-        ${h.link_to('continue on to the registration page', url=url('openid_register'))}.
+    <p>${_('If you would like to register with PylonsHQ instead,')}
+        ${h.link_to(_('continue on to the registration page'), url=url('openid_register'))}.
     
-    ${login_form(action=url('openid_associate')) | n}    
+    ${login_form(action=url('openid_associate')) | n}
 </div>
-<%def name="title()">${parent.title()} - Associate OpenID Account</%def>
+<%def name="title()">${parent.title()} - ${_('Associate OpenID Account')}</%def>
 <%inherit file="../layout.mako" />

kai/templates/accounts/forgot_password.mako

+<%!
+    from kai.model.forms import forgot_password_form
+%>
+<div class="yui-b content">
+    <h1>${_('Password Reset Request')}</h1>
+    <p>${_('Enter your e-mail address to request a password reset.')}</p>
+    ${forgot_password_form(action=url('forgot_password')) | n}
+</div>
+<%def name="title()">${parent.title()} - ${_('Password Reset Request')}</%def>
+<%inherit file="../layout.mako" />

kai/templates/accounts/login.mako

     from kai.model.forms import login_form, openid_login_form
 %>
 <div class="yui-b content">
-    <h1>Login</h1>
+    <h1>${_('Login')}</h1>
     ${login_form(action=url('account_login')) | n}
+    <p>${h.link_to('Forgot your password?', url=url('forgot_password'))}</p>
     
-    <hr noshade="noshade" size="1" />
-    <h1>Login with OpenID</h1>
+    <h1>${_('Login with OpenID')}</h1>
     ${openid_login_form(action=url('openid_login')) | n}
 </div>
-<%def name="title()">${parent.title()} - Home</%def>
+<%def name="title()">${parent.title()} - ${_('Login')}</%def>
 <%inherit file="../layout.mako" />

kai/templates/accounts/openid_register.mako

Empty file removed.

kai/templates/accounts/register.mako

 %>
 <div class="yui-b content">
     % if c.openid:
-    <h1>Finish Registration</h1>
+    <h1>${_('Finish Registration')}</h1>
     
-    <p>Using OpenID: ${c.openid}</p>
+    <p>${_('Using OpenID: %s' % c.openid)}</p>
     
     ${openid_registration_form(c.defaults, action=url('openid_register')) | n}
     
     % else:
-    <h1>Register for an Account</h1>
+    <h1>${_('Register for an Account')}</h1>
     
-    <p>Create an account for the PylonsHQ site. This account will let you:
+    <p>${_('Create an account for the PylonsHQ site. This account will let you:')}
         <ul>
-            <li>Post Snippets, Jobs, and Sites</li>
-            <li>Comment on Tracebacks, Snippets, and Pastes'</li>
+            <li>${_('Post Snippets, Jobs, and Sites')}</li>
+            <li>${_("Comment on Tracebacks, Snippets, and Pastes'")}</li>
         </ul>
     </p>
     
-    <p>These will be used to identify you as you contribute on the PylonsHQ site. Notifications
-        from the system will be sent to this email address, as well as lost password requests.</p>
+    <p>${_("""These will be used to identify you as you contribute on the PylonsHQ site. Notifications
+        from the system will be sent to this email address, as well as lost password requests""")}.</p>
     
-    <p><b>Note: </b>A valid e-mail address is required to activate your
-        account.</p>
+    <p>${_("""<b>Note: </b>A valid e-mail address is required to activate your
+        account.""")}</p>
     
     ${registration_form(action=url('account_register')) | n}
     
     <div id="openid_reg">
-        <h3>Register with OpenID</h3>
-        <p>To speed up registration, using OpenID will automatically fill-in details
-            that from the OpenID provider.</p>
+        <h3>${_('Register with OpenID')}</h3>
+        <p>${_("""To speed up registration, using OpenID will automatically fill-in details
+            that from the OpenID provider.""")}</p>
         
         ${openid_login_form(action=url('openid_create')) | n}
     </div>
     % endif
 </div>
-<%def name="title()">${parent.title()} - Home</%def>
+<%def name="title()">${parent.title()} - ${_('Registration')}</%def>
 <%inherit file="../layout.mako" />