1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-20 12:46:36 +02:00

Add localization system (gettext)

This commit is contained in:
Ansa89
2015-05-25 16:38:52 +02:00
committed by cnhenry
parent 0a2ad23c15
commit 737d29864b
7 changed files with 36 additions and 24 deletions

View File

@ -15,8 +15,9 @@ if [ -e "$loc.po" ]; then
echo "The translation file must not exist"
exit 1
else
msginit --no-translator -l $loc -o $loc.po -i toxic.pot
v=$(grep TOXIC_VERSION ../cfg/global_vars.mk | head -1 | cut -d "=" -f 2 | tr -d " ")
sed -e '1,5{/^#/d;}' $loc.po > $loc.po.tmp && mv $loc.po.tmp $loc.po
sed -e 's/.*Project-Id-Version:.*/"Project-Id-Version: Toxic '"$v"'\\n"/' $loc.po > $loc.po.tmp && mv $loc.po.tmp $loc.po
echo "PACKAGE_NAME=Toxic" > configure
echo "PACKAGE_VERSION=$v" >> configure
msginit --no-translator -l $loc -o $loc.po -i toxic.pot
rm -f configure
fi

View File

@ -1,4 +1,12 @@
#!/bin/bash
cd $(dirname $0)/..
xgettext -d toxic -o toxic.pot ../src/*
v=$(grep TOXIC_VERSION ../cfg/global_vars.mk | head -1 | cut -d "=" -f 2 | tr -d " ")
xgettext --default-domain="toxic" \
--from-code="UTF-8" \
--copyright-holder="Toxic Team" \
--msgid-bugs-address="JFreegman@tox.im" \
--package-name="Toxic" \
--package-version="$v" \
--output="toxic.pot" \
../src/*