Anki/qt/i18n/build-mo-files
evandrocoan 47ccd6638d Added -o pipefail to all set -e ensuring the build fails when some
operation with pipe exits error status.

# Conflicts:
#	Makefile
2020-02-24 20:18:56 -03:00

18 lines
421 B
Bash
Executable file

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