[glade/wip/inigomartinez/meson-i18n-catalog] i18n: Merge catalog translations



commit 68d459648c013909134577c1d9b5824a96d888c4
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Thu Mar 28 13:35:29 2019 +0100

    i18n: Merge catalog translations
    
    Catalog xml files are installed as they are. However, these files
    should also contain their translations merged with `gettext`.
    
    This has been changed so translations are now merged using meson's
    i18n module.

 plugins/gtk+/{gtk+.xml => gtk+.xml.in}                |  0
 .../gtk+/{gtkunixprint.xml => gtkunixprint.xml.in}    |  0
 plugins/gtk+/meson.build                              | 19 +++++++++++++------
 plugins/webkit2gtk/meson.build                        | 11 +++++++++--
 .../webkit2gtk/{webkit2gtk.xml => webkit2gtk.xml.in}  |  0
 tests/meson.build                                     |  2 +-
 6 files changed, 23 insertions(+), 9 deletions(-)
---
diff --git a/plugins/gtk+/gtk+.xml b/plugins/gtk+/gtk+.xml.in
similarity index 100%
rename from plugins/gtk+/gtk+.xml
rename to plugins/gtk+/gtk+.xml.in
diff --git a/plugins/gtk+/gtkunixprint.xml b/plugins/gtk+/gtkunixprint.xml.in
similarity index 100%
rename from plugins/gtk+/gtkunixprint.xml
rename to plugins/gtk+/gtkunixprint.xml.in
diff --git a/plugins/gtk+/meson.build b/plugins/gtk+/meson.build
index f86dafeb..ffc4eb7f 100644
--- a/plugins/gtk+/meson.build
+++ b/plugins/gtk+/meson.build
@@ -237,12 +237,19 @@ shared_module(
   kwargs: plugins_kwargs,
 )
 
-catalog_data = files('gtk+.xml')
+catalogs = ['gtk+.xml']
 if have_gtk_unix_print
-  catalog_data += files('gtkunixprint.xml')
+  catalogs += ['gtkunixprint.xml']
 endif
 
-install_data(
-  catalog_data,
-  install_dir: glade_datadir / glade_catalogdir,
-)
+foreach catalog: catalogs
+  i18n.merge_file(
+    catalog,
+    input: catalog + '.in',
+    output: '@BASENAME@',
+    po_dir: po_dir,
+    data_dirs: its_dir,
+    install: true,
+    install_dir: glade_datadir / glade_catalogdir,
+  )
+endforeach
diff --git a/plugins/webkit2gtk/meson.build b/plugins/webkit2gtk/meson.build
index a8306f10..697149d5 100644
--- a/plugins/webkit2gtk/meson.build
+++ b/plugins/webkit2gtk/meson.build
@@ -11,7 +11,14 @@ shared_module(
   kwargs: plugins_kwargs,
 )
 
-install_data(
-  'webkit2gtk.xml',
+catalog = 'webkit2gtk.xml'
+
+i18n.merge_file(
+  catalog,
+  input: catalog + '.in',
+  output: '@BASENAME@',
+  po_dir: po_dir,
+  data_dirs: its_dir,
+  install: true,
   install_dir: glade_datadir / glade_catalogdir,
 )
diff --git a/plugins/webkit2gtk/webkit2gtk.xml b/plugins/webkit2gtk/webkit2gtk.xml.in
similarity index 100%
rename from plugins/webkit2gtk/webkit2gtk.xml
rename to plugins/webkit2gtk/webkit2gtk.xml.in
diff --git a/tests/meson.build b/tests/meson.build
index 52594753..77bd5070 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -29,7 +29,7 @@ test_unit += [['toplevel-order', {'sources': sources}]]
 
 envs = [
   'GLADE_TESTING=1',
-  'GLADE_CATALOG_SEARCH_PATH=' + (source_root / 'plugins/gtk+'),
+  'GLADE_CATALOG_SEARCH_PATH=' + (build_root / 'plugins/gtk+'),
   'GLADE_MODULE_SEARCH_PATH=' + (build_root / 'plugins/gtk+'),
   'GLADE_PIXMAP_DIR=' + (source_root / 'data/icons'),
   'GLADE_ICON_THEME_PATH=' + (source_root / 'plugins/gtk+/icons/22x22'),


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