Skip to content

Enable translation of more error messages

What does the merge request do?

A lot of error messages previously were not translated. Some localized messages used Python 3.6+ f-Strings, which doesn't work (the f string is evaluated before the call to gettext).

This merge request enables translation of (likely almost) all error messages that can be raised by extensions.

Implementation notes

My regex was

\s\s\s\s\s.*(?<!default=)(?<!help=)(?<!dest=)(?<!== )(?<!!= )(?<!Color\()(?<!_\()(?<!.[gs]et\()(?<!"d", )"+\w(?!")

i.e. excluding Module and class docstrings, parameters of the argparser, equations including strings, Colors, attribute getter/setter, path data and single letter strings. There are still > 5000 results, through which I went manually.

Summary for release notes

More error messages shown when running extensions can now be translated.

Checklist

  • Add unit tests (if applicable)
  • Changes to inkex/ are well documented
  • Clean merge request history
Edited by Jonathan Neuhauser

Merge request reports