From ec58aec960b36e0b35e3222dbb424e43dc1f9917 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Sep 2021 11:22:34 +0100 Subject: [PATCH] Add custom update-pot target While working on a separate localization bug, I noticed that `po/exiv2.pot` hasn't been updated since 2017, and that with the removal of the autotools build system there's no longer any way to update it. Add a simple `update-pot` target to do so, and bring `po/POTFILES.in` up to date with the current source tree. I haven't updated `po/exiv2.pot` itself because that would be a large diff, though I've checked that the output looks reasonable. I suggest that maintainers do this. --- po/CMakeLists.txt | 17 +++++++++++++++++ po/Makevars | 41 ----------------------------------------- po/POTFILES.in | 29 +++++++++++++++-------------- 3 files changed, 32 insertions(+), 55 deletions(-) delete mode 100644 po/Makevars diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 87ad4c68..b56da95b 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -19,3 +19,20 @@ GETTEXT_CREATE_TRANSLATIONS(exiv2.pot ALL uk.po vi.po ) + +find_program(XGETTEXT xgettext) + +add_custom_target( + update-pot + COMMAND + ${XGETTEXT} -o ${CMAKE_CURRENT_SOURCE_DIR}/exiv2.pot + -D ${PROJECT_SOURCE_DIR} + --keyword=_ --keyword=N_ + --files-from=${CMAKE_CURRENT_SOURCE_DIR}/POTFILES.in + --from-code=UTF-8 + --copyright-holder='Andreas Huggel' + --msgid-bugs-address=ahuggel@gmx.net + --package-name=${CMAKE_PROJECT_NAME} + --package-version=${CMAKE_PROJECT_VERSION} + COMMENT "Extract translatable messages to exiv2.pot" +) diff --git a/po/Makevars b/po/Makevars deleted file mode 100644 index 41545181..00000000 --- a/po/Makevars +++ /dev/null @@ -1,41 +0,0 @@ -# Makefile variables for PO directory in any package using GNU gettext. - -# Usually the message domain is the same as the package name. -DOMAIN = $(PACKAGE) - -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ - -# This is the copyright holder that gets inserted into the header of the -# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -# package. (Note that the msgstr strings, extracted from the package's -# sources, belong to the copyright holder of the package.) Translators are -# expected to transfer the copyright for their translations to this person -# or entity, or to disclaim their copyright. The empty string stands for -# the public domain; in this case the translators are expected to disclaim -# their copyright. -COPYRIGHT_HOLDER = Andreas Huggel - -# This is the email address or URL to which the translators shall report -# bugs in the untranslated strings: -# - Strings which are not entire sentences, see the maintainer guidelines -# in the GNU gettext documentation, section 'Preparing Strings'. -# - Strings which use unclear terms or require additional context to be -# understood. -# - Strings which make invalid assumptions about notation of date, time or -# money. -# - Pluralisation problems. -# - Incorrect English spelling. -# - Incorrect formatting. -# It can be your email address, or a mailing list address where translators -# can write to without being subscribed, or the URL of a web page through -# which the translators can contact you. -MSGID_BUGS_ADDRESS = ahuggel@gmx.net - -# This is the list of locale categories, beyond LC_MESSAGES, for which the -# message catalogs shall be used. It is usually empty. -EXTRA_LOCALE_CATEGORIES = diff --git a/po/POTFILES.in b/po/POTFILES.in index 3e797ed3..270b9877 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,23 +1,24 @@ # List of source files with translatable strings, generated with # $ grep -l '[N ]_(' src/*.cpp src/*.hpp | sort -# Note: Please run 'make update-po' after changing this list +# Note: Please run 'make update-pot' after changing this list src/actions.cpp -src/canonmn.cpp -src/crwimage.cpp +src/canonmn_int.cpp +src/casiomn_int.cpp +src/crwimage_int.cpp src/datasets.cpp src/error.cpp src/exiv2.cpp -src/fujimn.cpp -src/minoltamn.cpp -src/nikonmn.cpp -src/olympusmn.cpp -src/panasonicmn.cpp -src/pentaxmn.cpp +src/fujimn_int.cpp +src/minoltamn_int.cpp +src/nikonmn_int.cpp +src/olympusmn_int.cpp +src/panasonicmn_int.cpp +src/pentaxmn_int.cpp src/properties.cpp -src/sigmamn.cpp -src/sonymn.cpp +src/samsungmn_int.cpp +src/sigmamn_int.cpp +src/sonymn_int.cpp src/tags.cpp -src/tiffimage.cpp -src/tiffvisitor.cpp -src/webpimage.cpp +src/tags_int.cpp +src/tiffimage_int.cpp