Skip to content

Commit

Permalink
Improve dev-scripts/update-translations.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Darazaki committed Apr 14, 2024
1 parent 3b3ebb0 commit 9a8a21e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dev-scripts/update-translations.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#!/bin/sh
set -e
echo '/!\ Make sure that po/_base.pot has been updated with the new translations!' 2>&1

printf "po/_base.pot: "
xgettext \
-f po/POTFILES \
-x po/_excluded.pot \
-cTR: \
--omit-header
msgmerge -UN po/_base.pot messages.po
rm -f messages.po 'po/_base.pot~'

for po_file in po/*.po
do
printf "$po_file: "
msgmerge "$po_file" po/_base.pot -U
msgmerge -UN "$po_file" po/_base.pot
rm -f "$po_file~"
done

sed -E 's/POT-Creation-Date: [0-9]{4}(-[0-9]{2}){2} [0-9]{2}:[0-9]{2}\+[0-9]{4}/'"POT-Creation-Date: $(date "+%Y-%m-%d %H:%M%z")"'/g' -i po/_base.pot po/*.po

0 comments on commit 9a8a21e

Please sign in to comment.