policycoreutils/README.translations

58 lines
2.1 KiB
Plaintext

How to update source files on weblate:
$ git clone git@github.com:fedora-selinux/selinux.git
$ cd selinux
# generate new potfiles
$ for p in policycoreutils python gui sandbox; do
cd $p/po
rm $p.pot
make $p.pot
sed -i 's/charset=CHARSET/charset=UTF-8/g' $p.pot
cd -
done
# https://translate.fedoraproject.org/projects/selinux/policycoreutils/en/
# Files -> Upload translations
# Repeat the process for python, gui and sandbox
# or use weblate command line tool (get your API key at https://translate.fedoraproject.org/accounts/profile/#api):
$ for p in policycoreutils python gui sandbox; do
wlc --key <API key> --url https://translate.fedoraproject.org/api/ upload --input $p/po/$p.pot selinux/rhel8$p/en --method=source
done
How to pull new translations from weblate
$ git clone git@github.com:fedora-selinux/selinux.git
# https://translate.fedoraproject.org/projects/selinux/policycoreutils
# Files -> Download translation files as ZIP file (save in selinux source directory)
# Repeat the process for python, gui and sandbox
# or use weblate command line tool
$ for p in policycoreutils python gui sandbox; do
wlc --key <API key> --url https://translate.fedoraproject.org/api/ download selinux/rhel8$p --output selinux
done
# unzip archives
$ cd selinux
$ for p in policycoreutils python gui sandbox; do
unzip -o selinux-rhel8$p.zip -d ..
mv rhel8$p/selinux/$p/po/*.po $p/po/
rm -rf selinux-rhel8$p.zip rhel8$p
done
$ git add .
$ git commit
How to update translations in *-po.tgz files
$ rhpkg clone policycoreutils; cd policycoreutils
$ mkdir weblate; cd weblate
$ for p in policycoreutils python gui sandbox; do
wlc --key <API key> --url https://translate.fedoraproject.org/api/ download selinux/rhel8$p --output .
unzip -o selinux-rhel8$p.zip
mv selinux/rhel8$p/selinux/$p .
rm -rf selinux-rhel8$p.zip selinux
cd $p
tar -c -f ../$p-po.tgz -z .
cd -
done
# upload new sources
$ cp *.tgz ..
$ cd ..
$ cat sources | head -n -4 > sources
$ for p in gui policycoreutils python sandbox; do
rhpkg upload $p-po.tgz
done