On Dec 15, 8:56 am, Andrea Cappelli <a.cappe...@gmail.com> wrote:
> Hi List,
> I'm a web2py user since few months and now I'm dealing with 2 problems
> regarding translations
>
> 1) With latest release (1.74.1) I get no sentence translated. I have 2
> files in languages/ (en.py and it.py) and some symlink (en-us.py, en-
> gb.py, it-it.py), but i receive always the text in italian (the
> language used as T argument)

If the string argument of T is Italian, then how I expect this to work
is this:

Translation is from some language, to some language.

In web2py case, there is only "static" translation, that is - the
languages/*.py files, so that all the logic has to decide is
What is the source language (the strings in the application)?
What is the client requested language (or acceptable lanugages), e.g.
http_accept_language?
If client_accept != source, then serve the appropriate string from the
first available languages/*.py file which matches one of the
http_accept_language

That is all.

In the past,  web2py would look for http_accept, and serve the first
languages/*.py file that was found, or NONE if none was found.

This was a BUG because (for example) if a client had an
accept_language sequence as ['en', 'it']   and there was no languages/
en.py,  but there was it.py, then Italian was ALWAYS served, EVEN when
the argument language to the T('This is an english source string')
was english.

The problem was that there was not concept of source language for the
application;  this was added, and the default of 'en' set.

Now, if you simply declare "My T() strings are 'it'!"  all will work
as it should.

>
> 2) If I use the old 1.65.1 (rev 992) all seems to work properly, but I
> have another problem. I wrote a python script to completely wget all
> pages (production server doesn't have python, so i have to put on it
> only html/css/js) and always works if I have only one language. If I
> have both en.py and it.py strange behaviour appear. The most annoying
> thing is that the language file is "corrupted" by web2py, in it i can
> see a comment reporting that the file is utf8 and an open curly
> bracket ( '{' ).
> Seems that web2py opens the file but for some reason fail when write
> to it

Can you share your script?

- Yarko
>
> There is someone that has similar issues?

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to