[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-ideas
Subject:    Re: [Python-ideas] i18n and Python tracebacks
From:       "Stephen J. Turnbull" <stephen () xemacs ! org>
Date:       2010-05-18 3:14:27
Message-ID: 87tyq5hpf0.fsf () uwakimon ! sk ! tsukuba ! ac ! jp
[Download RAW message or body]

Nick Coghlan writes:

 > It would actually be interesting to see just how far someone could get
 > [on translating tracebacks] purely with sys.excepthook.
 > 
 > It would be subject to some fairly significant limitations (particularly
 > when it comes to reparsing strings with interpolated values), but the
 > traceback parsing and comparison code in doctest may offer a good
 > starting point.

Actually, it shouldn't be too hard to handle the interpolations.  In
fact the language to be parsed is probably mostly pretty simple, and
can be automatically translated to BNF or whatever input your favorite
parsing library wants from the .pot file.  The generated grammar
probably would be on the order of the size of the .pot file, no?  It
could be stored with the .mos as a "pseudo-translation".

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
http://mail.python.org/mailman/listinfo/python-ideas
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic