On Dec 15, 3:18 pm, Andrea Cappelli <[email protected]> wrote:
> 2009/12/15 Yarko Tymciurak <[email protected]>:
> > If the string argument of T is Italian, then how I expect this to work
> > is this: [.....] That is all.
>
> This is clear, I have sentences in italian and i have 2 files
>
> --> it.py
> 'Ciao Mondo':'Ciao Mondo'
>
> --> en.py
> 'Ciao Mondo':'Hello World'
>
> and in some view I have T('Ciao Mondo')
>
> My hope is that I see 'Hello World' when browser accept_language in
> pointed on en, 'Ciao Mondo' if I request it and 'Ciao Mondo' (please
> read this as the dict key and not as a translation) when no lang or
> uknown lang is submitted
>
> I'm wrong?
You are not wrong - it should be exactly as this - and even more, you
should not need it.py in the case when T.current_languages is 'it' ---
simply because for correct operation, T() (that is, web2py) will NOT
go to a translation file (since it does not need to) if the source
language and the accept[ed] language are the same. This should make
very clear sense.
What you are saying is that when the accept language (that is, the
requested translation) does not exist, or not specified by the
client / browser, then web2py will serve in the language of the
source (the string arguments to T()). This is also true.
I think what you expect, and what web2py (now) does is exactly what is
and as it should naturally be.
Now with this understanding, you should be able to keep your solution
much simpler than you originally posted. Let us know how it goes.
Ciao,
- Yarko
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.