diff options
author | Marion <marion.zepf@gmail.com> | 2013-08-01 16:43:45 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-08-01 16:43:45 (GMT) |
commit | 0942aecc5b6dcb4d4ba1e5de926a0943da25cc06 (patch) | |
tree | fecea6d29847c912f3eb115c63d7599348a497cc /TurtleArt/taexportpython.py | |
parent | 555063f706111aaae91fe0e2714feab88c608463 (diff) |
enable i18n for the new error messages
Diffstat (limited to 'TurtleArt/taexportpython.py')
-rw-r--r-- | TurtleArt/taexportpython.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/TurtleArt/taexportpython.py b/TurtleArt/taexportpython.py index 4688ea9..78a6592 100644 --- a/TurtleArt/taexportpython.py +++ b/TurtleArt/taexportpython.py @@ -21,6 +21,7 @@ """ Python export tool """ import ast +from gettext import gettext as _ from os import linesep import re import util.codegen as codegen @@ -131,12 +132,13 @@ def _walk_action_stack(top_block, lc): prim = lc.get_prim_callable(block.primitive) # fail gracefully if primitive is not a Primitive object if not isinstance(prim, Primitive): - raise PyExportError("block is not exportable", block=block) + raise PyExportError(_("block is not exportable"), block=block) if prim.export_me: try: new_ast = prim.get_ast(*arg_asts) except ValueError: - raise PyExportError("error while exporting block", block=block) + raise PyExportError(_("error while exporting block"), + block=block) if isinstance(new_ast, (list, tuple)): ast_list.extend(new_ast) else: |