I think the cleanest approach would be to use the solution suggested by Peter Eisentraut:
msgfilter -i xx.po -o new.pot true
You can also save the gettext header by adding --keep-header before the final argument true . In this case, you need to check the received header, because it may contain language-specific instructions (for example, the number of multiple rules).
For Windows users: to use this approach, you need a program that acts like true (that is, it does nothing but run succesflully), for example true for Windows. I wrote for this reason.
source share