mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00

- ankiqt->aqt - move all the files in ui into the top level - move icons_rc.py into aqt/forms, and the qrc into designer/ - remove setuptools
36 lines
859 B
Bash
Executable file
36 lines
859 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# build translations
|
|
#
|
|
|
|
if [ ! -d "aqt" ]
|
|
then
|
|
echo "Please run this from the anki project directory"
|
|
exit
|
|
fi
|
|
|
|
oldpwd=$(pwd)
|
|
cd aqt
|
|
version=$(grep -i appVersion= __init__.py)
|
|
version2=$(expr substr $version 13 $((${#version}-13)))
|
|
|
|
allPyFiles=aqt.files
|
|
echo "Generating translations for version $version2"
|
|
for i in *.py forms/*.py
|
|
do
|
|
echo $i >> $allPyFiles
|
|
done
|
|
|
|
xgettext -s --no-wrap --package-name="aqt" --package-version=$version2 --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/aqt_(.*)\.po%locale/\1/LC_MESSAGES%')
|
|
outfile="$outdir/aqt.mo"
|
|
mkdir -p $outdir
|
|
msgfmt $file --output-file=$outfile
|
|
done
|
|
rm $allPyFiles
|
|
cd $oldpwd
|