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:
@ -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
|
||||
|
@ -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/*
|
||||
|
Reference in New Issue
Block a user