During my translation process, I found something tricky, probably a bug: 1. Open a tab in my Chrome to do the translate-submit-translate-submit cycle 2. Open another tab, do something, such as testing another web2py app. 3. Switch back to tab #1, do a submit. Oops, all language pairs are messed up. At this moment you have to cry if you don't have a backup.
Massimo might want to take a look about that. Anyway, I finished the chinese translation. Will mail to Massimo in a separate mail. On Feb21, 9:28am, mdipierro <[email protected]> wrote: > Go to > > http://127.0.0.1:8000/admin/default/design/admin > > mind of what you do. > > On Feb 20, 7:08 pm, Iceberg <[email protected]> wrote: > > > > > The latest fix to language.py is fine. And your fix to zh-cn.py > > reminds me one more trick, how about changing one more line of > > read_dict() like this? > > > try: > > return dict((k,v) for k,v in eval(lang_text).items() > > if v) # to strip empty translation > > except: > > ... > > > By the way, if you do feel reluctant to let go zh-cn.py, I can work > > out a full translated version. But, although I know a "full set" of > > strings to be translated can be obtained by clicking "update all > > language" in admin, however there there is no "EDIT" page for appadmin > > itself. So where can I start? > > > On Feb19, 9:47pm, mdipierro <[email protected]> wrote: > > > > I fixed what you suggested in trunk, please check it. I did not remove > > > zh-cn.py but I removed those lines that do not have a translation. > > > > Massimo > > > > On Feb 19, 7:09 am, Iceberg <[email protected]> wrote: > > > > > 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.

