Skip to content

Commit 2910e33

Browse files
Nick-HallGaryGriffin
authored andcommitted
Fix xgettext to add translation context and comments
The second parameter of the `_` function was not being processed and the comments were missing when run with "as-needed".
1 parent 883dba1 commit 2910e33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

make.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ def register(ptype, **kwargs):
402402
mkdir(f"{addon}/po")
403403
fnames = " ".join(glob.glob(f"{addon}/*.py"))
404404
system(
405-
f"xgettext --language=Python --keyword=_ --keyword=N_"
405+
f"xgettext --language=Python --keyword=_ --keyword=_:1,2c --keyword=N_"
406406
f" --from-code=UTF-8 --add-comments=Translators"
407407
f' -o "{addon}/po/template.pot" {fnames} '
408408
)
@@ -732,8 +732,8 @@ def register(ptype, **kwargs):
732732
mkdir("%(addon)s/po")
733733
fnames = " ".join(glob.glob(f"{addon}/*.py"))
734734
system(
735-
"xgettext --language=Python --keyword=_ --keyword=N_"
736-
" --from-code=UTF-8"
735+
"xgettext --language=Python --keyword=_ --keyword=_:1,2c --keyword=N_"
736+
" --from-code=UTF-8 --add-comments=Translators"
737737
f' -o "{addon}/po/temp.pot" {fnames} '
738738
)
739739
fnames = " ".join(glob.glob(f"{addon}/*.glade"))

0 commit comments

Comments
 (0)