A small patch in tools.py is also possible, the rest of the navbar-
function is neatly internationalized. There is a minimal downside: if
someone would call navbar with a translated string instead of T("a
greeting") as in the above suggestion this text would show up in de
language files at the LHS.

    def navbar(self,prefix='Welcome',action=None):
        request = self.environment.request
        T = self.environment.T
        if not action:
            action=URL(request.application,request.controller,'user')
        if prefix:
            prefix = prefix.strip()+' '

change last line to

           prefix = T(prefix.strip())+' '

I think the 'if' test will always be true due to the default value as
parameter.

I'll sent the patch separately

Nico

On 17 okt, 17:03, "Mr. Electronic" <[email protected]> wrote:
> Hi
>
> Thanks, that solved the problem. Still a beginner in web2py.
>
> Br.
> Mr. Electronic
>
> On 17 Okt., 18:59, mdipierro <[email protected]> wrote:
>
>
>
>
>
>
>
> > did you try edit the layout and replace it with
>
> > {{=auth.navbar(prefix=T("Welcome")}}
>
> > On Oct 17, 11:55 am, "Mr. Electronic" <[email protected]> wrote:
>
> > > Hi
>
> > > I trying to create my first web2py web site with login and because the
> > > page will be in danish. I'm working with the languages files. The only
> > > thing I have not been able to translate at the moment is the Welcome
> > > in thenavbar. The rest logout, login, profile, password, etc.
> > > translates without any problems at all but I can't translate the
> > > Welcome.
>
> > > The word Welcome does not show up in the languages files, I have tried
> > > to add the line 'Welcome':'Velkommen' but that didn't solve the
> > > problem.
>
> > > Is the Welcome missing a T('Welcome') in the auth module?
>
> > > Br.
> > > Mr. Electronic

Reply via email to