How to find unlabeled strings with gettext?

Does gettext have a way to warn me about strings that were not wrapped in _() or N_() ?

Basically, there is a way to get a list of all the lines that DO NOT match the keywords used by xgettext. So I want:

! xgettext source_code

Answer from the gettext mailing list:

  • Run xgettext once, without --extract-all, to get a normal POT file.
  • Run xgettext with --extract-all to get all the lines.
  • Run "msgcomm -less-than = 2" in the two POT files to get the difference, and see if the output is empty. You can use the --force-po option to run an empty POT file, even if both inputs are the same.

- Bruno Heibl

+4
source share
1 answer

You can compare the output with the --extract-all flag and without it ...

+1
source

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


All Articles