mirror of
https://github.com/Tha14/toxic.git
synced 2025-06-20 18:16:35 +02:00
Add localization system (gettext)
This commit is contained in:
BIN
translations/en.mo
Normal file
BIN
translations/en.mo
Normal file
Binary file not shown.
1602
translations/en.po
Normal file
1602
translations/en.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
translations/it.mo
Normal file
BIN
translations/it.mo
Normal file
Binary file not shown.
1602
translations/it.po
Normal file
1602
translations/it.po
Normal file
File diff suppressed because it is too large
Load Diff
19
translations/tools/create_mo.sh
Executable file
19
translations/tools/create_mo.sh
Executable 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
|
22
translations/tools/create_po.sh
Executable file
22
translations/tools/create_po.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
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
|
||||
fi
|
19
translations/tools/update_po.sh
Executable file
19
translations/tools/update_po.sh
Executable 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
|
4
translations/tools/update_pot.sh
Executable file
4
translations/tools/update_pot.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd $(dirname $0)/..
|
||||
xgettext -d toxic -o toxic.pot ../src/*
|
1574
translations/toxic.pot
Normal file
1574
translations/toxic.pot
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user