diff options
| author | Robert Tari <robert@tari.in> | 2024-08-27 14:43:59 +0200 |
|---|---|---|
| committer | Robert Tari <robert@tari.in> | 2024-08-27 14:43:59 +0200 |
| commit | 269aa4c7df03e1e581c01866c91bcfa5524d6334 (patch) | |
| tree | 2fcd022cbfcb82537b15ae334b563cfaf16e5dde /update-translations.sh | |
| parent | 4bfbd579171d9194956376c7153f378ff6eb9d4e (diff) | |
| download | ayatana-settings-269aa4c7df03e1e581c01866c91bcfa5524d6334.tar.gz ayatana-settings-269aa4c7df03e1e581c01866c91bcfa5524d6334.tar.bz2 ayatana-settings-269aa4c7df03e1e581c01866c91bcfa5524d6334.zip | |
Rewrite using C/CMake/Gtk4 and add some features/tweaks
Diffstat (limited to 'update-translations.sh')
| -rwxr-xr-x | update-translations.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/update-translations.sh b/update-translations.sh new file mode 100755 index 0000000..3b8ab1b --- /dev/null +++ b/update-translations.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Copyright (C) 2023 by Robert Tari <robert@tari.in> +# +# This package is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 of the License. +# +# This package is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/> + +PROJECT=$(grep -Po "^project *\(\K[^ ]+" "CMakeLists.txt") +VERSION=$(grep -Po "^project *\(.* +VERSION +\K[0-9]+\.[0-9]+\.[0-9]+" "CMakeLists.txt") +COPYRIGHT="Ayatana Indicators developers" +ORGANISATION="AyatanaIndicators" +xgettext --output="po/$PROJECT.pot" --no-wrap --copyright-holder="$COPYRIGHT" --package-name="$PROJECT" --package-version="$VERSION" --default-domain="$PROJECT" --msgid-bugs-address="https://github.com/$ORGANISATION/$PROJECT/issues" --force-po --language=C --keyword=_ src/*.c +xgettext --output="po/$PROJECT.pot" --no-wrap --omit-header --join-existing --default-domain="$PROJECT" --language=Glade "data/$PROJECT.ui" +sed -e "s/_Name=/Name=/" -e "s/_Comment=/Comment=/" "data/$PROJECT.desktop.in" > "data/$PROJECT.desktop.intl" +xgettext --output="po/$PROJECT.pot" --no-wrap --omit-header --join-existing --default-domain="$PROJECT" --keyword --keyword=Name --keyword=Comment --language=Desktop "data/$PROJECT.desktop.intl" +rm "data/$PROJECT.desktop.intl" +sed --in-place "s/\"Content-Type: text\/plain; charset=CHARSET\\\n\"/\"Content-Type: text\/plain; charset=UTF-8\\\n\"/" "po/$PROJECT.pot" +sed --in-place "s/# SOME DESCRIPTIVE TITLE./# Translation of $PROJECT in LANGUAGE/" "po/$PROJECT.pot" +sed --in-place "s/# Copyright (C) YEAR /# Copyright (C) $(date +%Y) /" "po/$PROJECT.pot" + +CATALOGS=$(find . -name '*.po' | sort) + +for CAT in $CATALOGS; do + LOCALE=$(basename ${CAT%.*}) + echo "${LOCALE}" >> "po/LINGUAS" + msgmerge --no-fuzzy-matching --update --backup=off "$CAT" "po/$PROJECT.pot" +done + +rm "po/LINGUAS" |
