I have a web application in which I have multiple translations using gettext. But now I have made a big redistribution of the application, and although most of the lines are the same, there are also many that have been significantly modified or deleted.
I use xgettext to create .po files, and it’s great when you can find new lines in the code and add them to the .po files, but I don’t see the possibility of deleting lines that are not found in the code.
Is there an automatic way to remove lines from .po files that are no longer in code?
, PO, , PO messages.pot, PO message.po, :
messages.pot
message.po
msgattrib --set-obsolete --ignore-file=messages.pot -o messages.po messages.po
. --set-obsolete msgattrib , --ignore-file , ( PO ).
--set-obsolete
--ignore-file
, :
msgattrib --no-obsolete -o messages.po messages.po
msgattrib .
msgattrib
find . -name '*.po' -print0 | while read -d '' -r file; do msgattrib --output-file="$file" --no-obsolete "$file"; done