mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
30 lines
677 B
Bash
Executable file
30 lines
677 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# build translations
|
|
#
|
|
|
|
if [ ! -d "locale" ]
|
|
then
|
|
echo "Please run this from the anki module directory"
|
|
exit
|
|
fi
|
|
|
|
allPyFiles=ankiqt.files
|
|
echo "Generating translations.."
|
|
for i in *.py ui/*.py forms/*.py
|
|
do
|
|
echo $i >> $allPyFiles
|
|
done
|
|
|
|
xgettext -s --no-wrap --files-from=$allPyFiles --output=locale/messages.pot
|
|
for file in locale/*.po
|
|
do
|
|
echo -n $file
|
|
msgmerge -s --no-wrap $file locale/messages.pot > $file.new && mv $file.new $file
|
|
outdir=$(echo $file | \
|
|
perl -pe 's%locale/ankiqt_(.*)\.po%locale/\1/LC_MESSAGES%')
|
|
outfile="$outdir/ankiqt.mo"
|
|
mkdir -p $outdir
|
|
msgfmt $file --output-file=$outfile
|
|
done
|
|
rm $allPyFiles
|