Hello,
Is there a way to use PoHelper plugin to merge a pot file into the currently edited po file?
I though one day I found a menu to do that but I don't find it again :)
Thanks,
Le 26/02/2020 à 20:02, Patrick ZAJDA via Users a écrit :
Hello,
Is there a way to use PoHelper plugin to merge a pot file into the currently edited po file?
No there is not ATM, you're expected to use `msgmerge` directly.
I probably could add this feature by calling `msgmerge` under the hood, it shouldn't be too complex and can be handy; but the main goal of the plugin was on easing editing, while leaving the plumbing to others (as usually extracting, merging and such are done by a build system).
This said, if you have a way of automatically determining the pot file to use, you could leverage the build commands to that effect, with the downside you'd have to reload the po file afterward. On a typical Autotools-based package, you can probably get away with something like :
msgmerge -U "%f" "$(sed -rn "s/^[[:blank:]]*PACKAGE=['"]([-+_a-zA-Z0-9]+)['"][[:blank:]]*$/\1/p" "$(dirname "%f)/../configure").pot"
…or anything more or less convoluted that works for you :)
Regards, Colomban