Creating multiple forms in a .pot file

I am internationalizing a python program and cannot get multiple forms into a .pot file. I noted a line that requires multiple translations using _pl (), for example.

self.write_info(_pl("%(num)d track checked", "%(num)d tracks checked", song_obj.song_count) % {"num" : song_obj.song_count})

Then I run: xgettext --language=Python --keyword=_pl --output=output.pot *.py Only the first (single) line is created in the pot file.

+3
source share
1 answer

I have not used this with Python and cannot verify at the moment, but give it a try --keyword=_pl:1,2.

From GNU gettext docs :

- keyword [= keywordspec] An additional keyword to search (without keywordspec means not to use keywords by default).

keywordspec C, xgettext . keywordspec 'id: argnum, xgettext argnumth . keywordspec "id: argnum1, argnum2, xgettext argnum1st argnum2nd / .

+3

Source: https://habr.com/ru/post/1705819/


All Articles