开发者

Howto find unmarked strings with gettext?

开发者 https://www.devze.com 2022-12-24 23:40 出处:网络
Does gettext have a way to warn me about strings that have not been wrapped in _() or N_()? Basically is there a way to get a list of all string开发者_如何学Gos that do NOT match the keywords used by

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

Basically is there a way to get a list of all string开发者_如何学Gos that do NOT match the keywords used by xgettext. So, I want:

! xgettext source_code

Answer from the gettext mailing list:

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

-- Bruno Haible


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

0

精彩评论

暂无评论...
验证码 换一张
取 消