po/make_pot: use gettext to process desktop file

gettext understands desktop files since 0.19 (2014),
so there’s no need for custom grep logic. This change
matches meson’s i18n which also uses gettext for this.

As a side efffect of this some long strings now get
broken into multiple lines (cosmetic only) and some
blank line gaps are normalised by gettext.

Cherry picks: 0e29c8d0e4
With fixups from: e98b7292f1
This commit is contained in:
Oneric 2023-04-29 01:33:40 +02:00
parent afa290ecfb
commit 6d9901ee3c
1 changed files with 2 additions and 6 deletions

View File

@ -42,12 +42,8 @@ find ../automation -name *.lua \
| sed 's/\\/\\\\\\\\/g' \
| maybe_append
for i in 'Name' 'GenericName' 'Comment' 'Keywords'
do
grep ^$i -n ../packages/desktop/aegisub.desktop.in.in \
| sed 's/\([0-9]\+\):[^=]\+=\(.*\)$/aegisub.desktop|\1|"\2"/' \
| maybe_append
done
xgettext ../packages/desktop/aegisub.desktop.in.in \
--language=Desktop --join-existing --omit-header -o aegisub.pot
for i in 'name' 'summary' 'p' 'li' 'caption'; do
xmlstarlet sel -t -v "//$i" ../packages/desktop/aegisub.appdata.xml.in.in | jq -R .