[geary/wip/771643-replace-intltool] Workaround xgettext not recognising Elementary Contractor files.



commit da04c3a95bab828d9eb2629cfd528983de31d860
Author: Michael James Gratton <mike vee net>
Date:   Thu Oct 26 17:07:36 2017 +1100

    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 ++-
 ...ontract.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(-)
---
diff --git a/desktop/CMakeLists.txt b/desktop/CMakeLists.txt
index 6f0d0b3..5ade054 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 0f3db85..e90d028 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -9,6 +9,7 @@ IF (XGETTEXT_FOUND)
         --add-comments
         --keyword=C_:1c,2
         --keyword=NC_:1c,2
+        --keyword=Description
     )
     GETTEXT_CREATE_TRANSLATIONS(ALL ${TRANSLATED}
         COMMENT "Creating translations."
diff --git a/po/Makevars b/po/Makevars
index 321f6c9..b4bf4c3 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=C_:1c,2 --keyword=NC_:1c,2
+XGETTEXT_OPTIONS = --from-code=UTF-8 --add-comments --keyword=C_:1c,2 --keyword=NC_:1c,2 
--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 9f17fd5..c26838f 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]