From f7a57c82bceeeae33b3244ba33b4844f5b692298 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 17 May 2018 22:05:01 +0200 Subject: Localize notification emails Add support for translating notification emails and send localized notifications, based on the user's language preferences. Also, update the translations Makefile to add strings from the notification script to the message catalog. Implements FS#31850. Signed-off-by: Lukas Fleischer --- po/Makefile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'po/Makefile') diff --git a/po/Makefile b/po/Makefile index d0ed7418..78073f86 100644 --- a/po/Makefile +++ b/po/Makefile @@ -48,23 +48,32 @@ all: ${MOFILES} lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ msgmerge -U --no-location --lang="$$lang" $< aur.pot -POTFILES: - find ../web -type f -name '*.php' -printf '%P\n' | sort >POTFILES +POTFILES-php: + find ../web -type f -name '*.php' -printf '%P\n' | sort >POTFILES-php -update-pot: POTFILES +POTFILES-py: + find ../aurweb -type f -name '*.py' -printf '%P\n' | sort >POTFILES-py + +update-pot: POTFILES-php POTFILES-py pkgname=AUR; \ pkgver=`sed -n 's/.*"AURWEB_VERSION", "\(.*\)".*/\1/p' ../web/lib/version.inc.php`; \ xgettext --default-domain=aur -L php --keyword=__ --keyword=_n:1,2 \ --add-location=file --add-comments=TRANSLATORS: \ --package-name="$$pkgname" --package-version="$$pkgver" \ --msgid-bugs-address='${MSGID_BUGS_ADDRESS}' \ - --directory ../web --files-from POTFILES -o aur.pot + --directory ../web --files-from POTFILES-php -o aur.pot; \ + xgettext --default-domain=aur -L python --join-existing \ + --keyword=translate \ + --add-location=file --add-comments=TRANSLATORS: \ + --package-name="$$pkgname" --package-version="$$pkgver" \ + --msgid-bugs-address='${MSGID_BUGS_ADDRESS}' \ + --directory ../aurweb --files-from POTFILES-py -o aur.pot update-po: ${MAKE} ${UPDATEPOFILES} clean: - rm -f *.mo *.po\~ POTFILES + rm -f *.mo *.po\~ POTFILES-php POTFILES-py install: all for l in ${LOCALES}; do mkdir -p ${DESTDIR}${PREFIX}/$$l/LC_MESSAGES/; done @@ -73,4 +82,4 @@ install: all uninstall: for l in ${LOCALES}; do rm -rf ${DESTDIR}${PREFIX}/$$l/LC_MESSAGES/; done -.PHONY: all update-pot update-po clean install uninstall POTFILES +.PHONY: all update-pot update-po clean install uninstall POTFILES-php POTFILES-py -- cgit v1.2.3-24-g4f1b