2020-02-26 08:47:02 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# build mo files
|
|
|
|
#
|
|
|
|
set -eo pipefail
|
|
|
|
|
|
|
|
targetDir="../aqt_data/locale/gettext"
|
|
|
|
mkdir -p $targetDir
|
|
|
|
|
2020-02-27 11:37:44 +01:00
|
|
|
echo "Compiling *.po..."
|
2020-02-26 08:47:02 +01:00
|
|
|
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
|