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.
This commit is contained in:
Michael James Gratton 2017-10-26 17:07:36 +11:00
parent 643c65a954
commit e05de4ccec
5 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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."

View file

@ -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

View file

@ -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