From 1ca69e6b2cd3cf089cdcb841f1b0a522a40746de Mon Sep 17 00:00:00 2001 From: Emily Mabrey Date: Sun, 25 Jul 2021 22:56:18 -0400 Subject: [PATCH] Add locale related files Add `.weblate` config to make usage of wlc CLI tool easier. Add `regen_POT_file.sh` to allow POT file update or regeneration. Signed-off-by: Emily Mabrey --- .weblate | 3 +++ locale/regen_POT_file.sh | 56 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .weblate create mode 100644 locale/regen_POT_file.sh diff --git a/.weblate b/.weblate new file mode 100644 index 000000000..65c85ae30 --- /dev/null +++ b/.weblate @@ -0,0 +1,3 @@ +[weblate] +url = https://hosted.weblate.org/api/ +translation = tenacity/tenacity diff --git a/locale/regen_POT_file.sh b/locale/regen_POT_file.sh new file mode 100644 index 000000000..6e4bdadf3 --- /dev/null +++ b/locale/regen_POT_file.sh @@ -0,0 +1,56 @@ +#!/bin/sh +# Run this script with locale as the current directory +set -o errexit +echo ";; Recreating tenacity.pot using .h, .cpp and .mm files" +for path in ../modules/mod-* ../libraries/lib-* ../include ../src ; do + find $path -name \*.h -o -name \*.cpp -o -name \*.mm +done | LANG=c sort | \ +sed -E 's/\.\.\///g' |\ +xargs xgettext \ +--no-wrap \ +--default-domain=tenacity \ +--directory=.. \ +--keyword=_ --keyword=XO --keyword=XC:1,2c --keyword=XXO --keyword=XXC:1,2c --keyword=XP:1,2 --keyword=XPC:1,2,4c \ +--add-comments=" i18n" \ +--add-location=file \ +--copyright-holder='Tenacity Contributors' \ +--package-name="tenacity" \ +--package-version='3.0.4' \ +--msgid-bugs-address="emabrey@tenacityaudio.org" \ +--add-location=file -L C -o tenacity.pot +echo ";; Adding nyquist files to tenacity.pot" +for path in ../plug-ins ; do find $path -name \*.ny -not -name rms.ny; done | LANG=c sort | \ +sed -E 's/\.\.\///g' |\ +xargs xgettext \ +--no-wrap \ +--default-domain=tenacity \ +--directory=.. \ +--keyword=_ --keyword=_C:1,2c --keyword=ngettext:1,2 --keyword=ngettextc:1,2,4c \ +--add-comments=" i18n" \ +--add-location=file \ +--copyright-holder='Tenacity Contributors' \ +--package-name="tenacity" \ +--package-version='3.0.4' \ +--msgid-bugs-address="emabrey@tenacityaudio.org" \ +--add-location=file -L Lisp -j -o tenacity.pot +#Disable PO file modification because it will hurt Weblate merge -- emabrey. +#if test "${TENACITY_ONLY_POT:-}" = 'y'; then +# return 0 +#fi +#echo ";; Updating the .po files - Updating Project-Id-Version" +#for i in *.po; do +# sed -e '/^"Project-Id-Version:/c\ +# "Project-Id-Version: tenacity 3.0.4\\n"' $i > TEMP; mv TEMP $i +#done +#echo ";; Updating the .po files" +#sed 's/.*/echo "msgmerge --lang=& &.po tenacity.pot -o &.po";\ +#msgmerge --no-wrap --lang=& &.po tenacity.pot -o &.po;/g' LINGUAS | bash +#echo ";; Removing '#~|' (which confuse Windows version of msgcat)" +#for i in *.po; do +# sed '/^#~|/d' $i > TEMP; mv TEMP $i +#done +#echo "" +echo ";; POT file generated" +echo "" +head -n 11 tenacity.pot | tail -n 3 +wc -l tenacity.pot