furnace/scripts/update-po.sh

28 lines
809 B
Bash
Raw Normal View History

2024-05-26 08:57:26 +00:00
#!/bin/bash
2024-08-29 07:29:32 +00:00
FUR_VERSION="0.6.7"
2024-05-26 08:57:26 +00:00
EXPORT_LANGS=("de" "es" "fr" "fi" "hy" "id" "ja" "ko" "nl" "pl" "pt_BR" "ru" "sk" "sv" "th" "tr" "uk" "zh" "zh_HK")
2024-05-26 08:57:26 +00:00
echo '#
msgid ""
msgstr ""' > po/furnace.pot
echo '"Project-Id-Version: furnace '"$FUR_VERSION"'\n"' >> po/furnace.pot
echo '"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
' >> po/furnace.pot
find src/ -type f -regex ".*\(cpp\|h\)$" | xargs xgettext --omit-header -k_ -k_N -L C++ --from-code=UTF-8 -j -o po/furnace.pot || exit 1
2024-05-26 08:57:26 +00:00
cd po
for i in ${EXPORT_LANGS[@]}; do
if [ -e "$i".po ]; then
echo "merging $i"".po..."
2024-07-10 20:22:20 +00:00
msgmerge --backup=none -N -U "$i".po furnace.pot || exit 1
2024-05-26 08:57:26 +00:00
else
echo "creating $i"".po..."
2024-06-23 21:20:58 +00:00
msginit -i furnace.pot -l "$i".UTF-8 --no-translator || exit 1
2024-05-26 08:57:26 +00:00
fi
done