I have the following directory structure:
webiste/
locale/
en/
LC_MESSAGES/
translation.po
de/
LC_MESSAGES/
translation.po
fr/
LC_MESSAGES/
translation.po
I am using the find
command to get to all the .po
files and apply the msgfmt
command to them.
So when I run this command:
find . -name \*.po
The output is
./locale/fr/LC_MESSAGES/translation.po
./locale/de/LC_MESSAGES/translation.po
./locale/en/LC_MESSAGES/translation.po
Just as expected but now I when I add this:
find . -name \*.po -exec msgfmt "{}" \;
It outputs nothing and it does not create the .mo files it is supposed to (If I do it to each file individually the msgfmt
command works as expected).
This is weird since if I change the command to this:
find . -name *.po -exec echo "{}" \;
It outputs the names of the files correctly.
I've sort of solved it like this:
find . -name \*.po -exec msgfmt "{}" -o {}.mo \;
But it outputs a translation.po.mo
How can this be done?