From e05de4cceccf08d1f60f00b18c4373bfdfe25d8e Mon Sep 17 00:00:00 2001 From: Michael James Gratton Date: Thu, 26 Oct 2017 17:07:36 +1100 Subject: [PATCH] Workaround xgettext not recognising Elementary Contractor files. We can't just simply run xgettext twice (once as normal, once with just the contractor file and passing "--desktop" as an arg, since l10n.gnome.org won't pick up the second pass and the contract will remain untranslated. So work around by renaming the contractor file such that it is recognised, then rename it back to normal when translating it. * desktop/geary-attach.contract.in: Renamed to desktop/geary-attach.contract.desktop.in. * desktop/CMakeLists.txt: Undo the rename when translating. * po/CMakeLists.txt, po/Makevars: Add a xgettext keyword for the contractor Description field. * po/POTFILES.in: Chase the file rename. --- desktop/CMakeLists.txt | 3 ++- ...ary-attach.contract.in => geary-attach.contract.desktop.in} | 0 po/CMakeLists.txt | 1 + po/Makevars | 2 +- po/POTFILES.in | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) rename desktop/{geary-attach.contract.in => geary-attach.contract.desktop.in} (100%) diff --git a/desktop/CMakeLists.txt b/desktop/CMakeLists.txt index 6f0d0b37..5ade054c 100644 --- a/desktop/CMakeLists.txt +++ b/desktop/CMakeLists.txt @@ -61,7 +61,8 @@ else (DISABLE_CONTRACT) if (GETTEXT_FOUND) add_custom_target (geary-attach.contract ALL ${GETTEXT_MSGFMT_EXECUTABLE} --desktop -d '${CMAKE_SOURCE_DIR}/po' - --template '${CMAKE_CURRENT_SOURCE_DIR}/geary-attach.contract.in' -o geary-attach.contract + --template '${CMAKE_CURRENT_SOURCE_DIR}/geary-attach.contract.desktop.in' -o geary-attach.contract + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/geary-attach.contract.desktop.in ) # Can't validate Contractor file since it isn't a valid Desktop diff --git a/desktop/geary-attach.contract.in b/desktop/geary-attach.contract.desktop.in similarity index 100% rename from desktop/geary-attach.contract.in rename to desktop/geary-attach.contract.desktop.in diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index d6adb1b8..88fddf45 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -12,6 +12,7 @@ IF (XGETTEXT_FOUND) --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 + --keyword=Description ) GETTEXT_CREATE_TRANSLATIONS(ALL ${TRANSLATED} COMMENT "Creating translations." diff --git a/po/Makevars b/po/Makevars index bab9cb04..b29f35ff 100644 --- a/po/Makevars +++ b/po/Makevars @@ -9,7 +9,7 @@ top_builddir = .. # These options get passed to xgettext. # XXX Keep these in sync with CMakeLists.txt -XGETTEXT_OPTIONS = --from-code=UTF-8 --add-comments --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 +XGETTEXT_OPTIONS = --from-code=UTF-8 --add-comments --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --keyword=Description # 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 diff --git a/po/POTFILES.in b/po/POTFILES.in index cb893d42..56819ce6 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,7 +1,7 @@ desktop/org.gnome.Geary.appdata.xml.in desktop/org.gnome.Geary.desktop.in desktop/geary-autostart.desktop.in -desktop/geary-attach.contract.in +desktop/geary-attach.contract.desktop.in src/geary-version.vala.in src/client/accounts/account-dialog-account-list-pane.vala src/client/accounts/account-dialog-add-edit-pane.vala