anki/qt/po/scripts/build-mo-files
Damien Elmes 46fadc2a82 don't abort build if mo file fails; rename files for consistency
Issues are now checked for in CI, so there's no need to break the
build for everyone each time there's a problem with the gettext
catalogs.
2020-02-26 17:47:02 +10:00

21 lines
466 B
Bash
Executable File

#!/bin/bash
#
# build mo files
#
set -eo pipefail
targetDir="../aqt_data/locale/gettext"
mkdir -p $targetDir
echo "Compiling *.repo..."
for file in repo/desktop/*/anki.po
do
outdir=$(echo "$file" | \
perl -pe "s%repo/desktop/(.*)/anki.po%$targetDir/\1/LC_MESSAGES%")
outfile="$outdir/anki.mo"
mkdir -p $outdir
(msgmerge -q "$file" repo/desktop/anki.pot | msgfmt - --output-file="$outfile") || (
echo "error building $file"
)
done