I18n: translate error messages generated with WM_report() and family

Many error messages were translated when using `BKE_report()` or
`BKE_reportf()`, directly, but others were missing because they used
`WM_report()` or `WM_reportf()`.

This commit adds these two functions to the list of functions used in
the message extraction regex.

In addition, `WM_reportf()` is modified so that the format string is
translated before formatting actually occurs.
This commit is contained in:
Damien Picard 2023-03-17 15:35:21 +01:00
parent 3af5d2f0a8
commit 006bc603f8
2 changed files with 3 additions and 1 deletions

View file

@ -243,7 +243,7 @@ PYGETTEXT_KEYWORDS = (() +
tuple(("{}\\((?:[^\"',]+,){{1,2}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf",
"CTX_wm_operator_poll_msg_set")) +
"CTX_wm_operator_poll_msg_set", "WM_report", "WM_reportf")) +
tuple(("{}\\((?:[^\"',]+,){{3}}\\s*" + _msg_re + r"\s*\)").format(it)
for it in ("BMO_error_raise",)) +