Some sugestions to improvements in translation/localization

10 views
Skip to first unread message

Alexandre Andrade

unread,
Jul 30, 2009, 1:43:32 AM7/30/09
to web...@googlegroups.com
Massimo,

I have a few sugestions to improve the localization of app welcome, so it will be easier to international users:


  1. Set the labels of registration table :


db.auth_user.first_name.label=T("First Name")

db.auth_user.last_name.label=T("Last Name")

db.auth_user.email.label=T("Email")

db.auth_user.password.label=T("Password")


  1. alter views/default/user.html to :


{{extend 'layout.html'}}

<h2>{{=request.args(0).replace('_',' ').capitalize()}}</h2>

{{=form}}

{{if request.args(0)=='login':}}

<a href="{{=URL(r=request,args='register')}}">{{T('register')}}</a><br />

<a href="{{=URL(r=request,args='retrieve_password')}}">{{T('lost password')}}</a><br />

{{pass}}



3. Alter the menu in portal/views/layout.html to:

            {{if response.menu_auth:}}
            <h2>{{T(Authentication)}}</h2>
            {{=MENU(response.menu_auth)}}
            {{pass}}
            {{if response.menu:}}
            <h2>{{T(Main Menu)}}</h2>
            {{=MENU(response.menu)}}
            {{pass}}
            {{if response.menu_edit:}}
            <h2>{{T(Edit This App)}}</h2>
            {{=MENU(response.menu_edit)}}
            {{pass}}


  1. I can't find how translate the h2 title of auth pages, so I can't translate “register”, “login” and “retrieve password “

Look it is generated in code, note in layouts. If someone have some tip, I will be pleased:


Register

Nome:

Sobrenome:

Email:

Password:

Verificar Senha:



-----------------------------------------------------------------


--
Atenciosamente

--
=========================
Alexandre Andrade
Hipercenter.com

Fran

unread,
Jul 30, 2009, 4:29:55 AM7/30/09
to web2py-users
On Jul 30, 6:43 am, Alexandre Andrade <alexandrema...@gmail.com>
wrote:
> I can't find how translate the h2 title of auth pages, so I can't
> translate “register”, “login” and “retrieve password “
> Look it is generated in code, note in layouts.

It is in the view: user.html

However it is not Internationalisable as-is:
<h2>{{=request.args(0).replace('_',' ').capitalize()}}</h2>

I think this needs replacing with something like:
<h2>
{{if request.args(0)=='login':}}
{{=T('Login')}}
{{elif request.args(0)=='register':}}
{{=T('Register')}}
{{elif request.args(0)=='retrieve_password':}}
{{=T('Retrieve Password')}}
{{elif request.args(0)=='profile':}}
{{=T('Profile')}}
{{pass}}
</h2>

F

Alexandre Andrade

unread,
Jul 30, 2009, 9:55:29 AM7/30/09
to web...@googlegroups.com
It works.

Thanks, Fran !



2009/7/30 Fran <franc...@googlemail.com>
Reply all
Reply to author
Forward
0 new messages