I've a build script that scan source dir (PHP) and execute the xgettext --join-existing ... for updated translation and save into a pot file, e.g.
find . -type f -name '*.php' -not -path './vendor/*' |
xargs xgettext --join-existing --keyword=_e --keyword=_x
--keyword=__ --from-code=UTF-8 --default-domain=myapp
--output=languages/myapp/myapp.pot
I don't know why, after several times of code refactoring and building, the pot file will have something like this
#: src/Member/Auth.php:196
#: src/Member/Auth.php:135
msgid "Login failed!"
msgstr ""
Why there are two lines of source/line in the comment? (I guess it was due to we've moved the message around in the source.)
So, how to make the xgettext ignore if the same file has updated content?
Or should I not recommend to use
--join-existingin the build script? (But sometimes we have manual item in the pot file, so how to solve?)
Would here be a problem if using poedit? It is GUI application with „Update“ button. Poedit scans all files and collects all translatable strings. I have used it a lot for a long time and it does its job perfect.