How to collect strings for i18n from files in different languages with xgettext

StackOverflow https://stackoverflow.com/questions/14145173

  •  12-01-2022
  •  | 
  •  

문제

By default xgettext will guess file type from its extension. However, I have JavaScript files (with .js extension) which it doesn't currently understand. So, I have to specify language manually, Java seems like a good choice. But then, I also have Glade files (XML), which obviously cannot be parsed as Java... When I specify multiple --language options on command line, only the last seems to have any effect.

It seems to be a non-issue for projects with file types understood by xgettext (e.g. C and Glade).

도움이 되었습니까?

해결책

It seems that --join-existing option is what I need. I.e. run xgettext separately for each language with the same output file, only adding --join-existing for each but the first. Note that if output file doesn't have suffix .pot, xgettext will print a (useless) warning about charset.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top