[Python-ideas] i18n and Python tracebacks
Stephen J. Turnbull
stephen at xemacs.org
Tue May 18 05:14:27 CEST 2010
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".
More information about the Python-ideas
mailing list