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

Add localization system (gettext)

This commit is contained in:
Ansa89
2015-05-25 16:38:52 +02:00
parent d0a7ca17d2
commit 51a1c660b4
36 changed files with 5546 additions and 437 deletions

BIN
translations/en.mo Normal file

Binary file not shown.

1599
translations/en.po Normal file

File diff suppressed because it is too large Load Diff

BIN
translations/it.mo Normal file

Binary file not shown.

1607
translations/it.po Normal file

File diff suppressed because it is too large Load Diff

19
translations/tools/create_mo.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
cd $(dirname $0)
loc="$1"
while [ -z "$1" -a -z "$loc" ]; do
echo -n "Insert locale (for example \"en\"): "
read loc
done
cd ..
if [ ! -e "$loc.po" ]; then
echo "File \"$loc.po\" not found"
echo "The translation file must exist"
exit 1
else
msgfmt -c -o $loc.mo $loc.po
fi

23
translations/tools/create_po.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
cd $(dirname $0)
loc="$1"
while [ -z "$1" -a -z "$loc" ]; do
echo -n "Insert locale to create (for example \"en\"): "
read loc
done
cd ..
if [ -e "$loc.po" ]; then
echo "File \"$loc.po\" found"
echo "The translation file must not exist"
exit 1
else
v=$(grep TOXIC_VERSION ../cfg/global_vars.mk | head -1 | cut -d "=" -f 2 | tr -d " ")
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

19
translations/tools/update_po.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
cd $(dirname $0)
loc="$1"
while [ -z "$1" -a -z "$loc" ]; do
echo -n "Insert locale to update (for example \"en\"): "
read loc
done
cd ..
if [ ! -e "$loc.po" ]; then
echo "File \"$loc.po\" not found"
echo "The translation file must exist"
exit 1
else
msgmerge -U --backup=none --previous $loc.po toxic.pot
fi

View File

@ -0,0 +1,12 @@
#!/bin/bash
cd $(dirname $0)/..
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/*

1574
translations/toxic.pot Normal file

File diff suppressed because it is too large Load Diff