Hi there,

I upgrade from web2py 1.74.8 to latest trunk and then my admin can not
login normally, instead it generates error ticket. Tracing down the
bug, I found the reason and cure.

1. Since rev 146, web2py uses the browser's prefer language as the
default language setting. It is good. My browser's prefer language is
"zh-cn" (Chinese), it is also fine. But it happened that the current
Chinese language file, web2py\applications\admin\languages\zh-cn.py,
introduced by Jobinson in rev79 (http://code.google.com/p/web2py/
source/detail?r=063cc48352), is totally unacceptable. It contains the
unmatched-quotation syntax error, besides it does not finish
translation at all, many english strings are "translated" into empty
string, and some others are not translated precisely.

So the first suggestion, in my humble opinion, is to delete web2py
\applications\admin\languages\zh-cn.py.  After all, a web2py developer/
user should be able to read all english words in admin app, so no need
to have a non-english version which is not likely to be always
synchronized with the official ones.


2. On the other hand, web2py's core code should be robust, to survive
a language file with syntax error inside (now we know it happens). So
the last line of function read_dict(filename) of web2py/gluon/
languages.py, should change into:

    try:
        return eval(lang_text)
    except:
        import logging
        logging.exception('Syntax error in %s'%filename)
        return {}


Regards,
Iceberg

-- 
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.

Reply via email to