Modified according to new locale directory layout

This commit is contained in:
pezcurrel 2023-12-29 10:02:03 +01:00
parent 560db4d69d
commit 9ece96fcd9

View file

@ -9,7 +9,7 @@ if [ $1 != "updpo" ] && [ $1 != "updmo" ]; then
exit 1
fi
langs=("ar" "ars" "ca" "cs" "de" "en" "es" "fa" "fr" "gl" "id" "it" "nl" "pl" "pt" "pt_BR" "ru" "tr" "uk")
langs=("ar_AE" "be_BY" "ca_ES" "cs_CZ" "de_DE" "en_EN" "es_ES" "fa_IR" "fr_FR" "gl_ES" "id_ID" "it_IT" "nl_NL" "pl_PL" "pt_BR" "pt_PT" "ru_RU" "tr_TR" "uk_UA")
basedir=$(dirname "$0")
cd "$basedir"
@ -19,18 +19,18 @@ if [ $1 == "updpo" ]; then
echo "Aggiorno masthelp.pot con xgettext"
xgettext --no-wrap --from-code utf-8 --add-comments --copyright-holder masthelp@insicuri.net --package-name mastodon.help --package-version 1.1 --msgid-bugs-address masthelp@insicuri.net web/site/*.php web/lib/*.php -o - | sed -e 's/^"Language: \\n"$/"Language: en\\n"/' > web/site/locale/masthelp.pot
echo "Aggiorno masthelp.po per «en» con msgen"
msgen --no-wrap web/site/locale/masthelp.pot -o - | sed -e 's/msgstr "Not available{singular}"/msgstr "Not available"/' -e 's/msgstr "Not available{plural}"/msgstr "Not available"/' > web/site/locale/en/en_US.UTF-8/LC_MESSAGES/masthelp.po
msgen --no-wrap web/site/locale/masthelp.pot -o - | sed -e 's/msgstr "Not available{singular}"/msgstr "Not available"/' -e 's/msgstr "Not available{plural}"/msgstr "Not available"/' > web/site/locale/en_EN/LC_MESSAGES/masthelp.po
for lang in ${langs[@]}; do
if [ $lang != "en" ]; then
if [ $lang != "en_EN" ]; then
echo "Aggiorno masthelp.po per «$lang» con msgmerge"
msgmerge --update --no-wrap web/site/locale/$lang/en_US.UTF-8/LC_MESSAGES/masthelp.po web/site/locale/masthelp.pot
msgmerge --update --no-wrap web/site/locale/$lang/LC_MESSAGES/masthelp.po web/site/locale/masthelp.pot
fi
done
echo "Fatto! Ora puoi editare i vari masthelp.po."
elif [ $1 == "updmo" ]; then
for lang in ${langs[@]}; do
echo "Aggiorno masthelp.mo per «$lang»"
msgfmt web/site/locale/$lang/en_US.UTF-8/LC_MESSAGES/masthelp.po -o web/site/locale/$lang/en_US.UTF-8/LC_MESSAGES/masthelp.mo
msgfmt web/site/locale/$lang/LC_MESSAGES/masthelp.po -o web/site/locale/$lang/LC_MESSAGES/masthelp.mo
done
echo "Fatto! :-)"
else