[gnome-boxes/wip/inigomartinez/meson: 10/13] meson: Use meson's i18n module



commit 4c3ffdb0ebd1a291225ea6340d0913f71f0963af
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Sun Dec 10 03:23:54 2017 +0100

    meson: Use meson's i18n module
    
    meson has a i18n module which can be used to merge translations
    using msgfmt.
    
    This patch takes advantage of this module instead of using custom
    targets.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791421

 data/meson.build |   20 +++++++++++---------
 meson.build      |    2 --
 2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index d4125ff..28a9fd1 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -5,12 +5,14 @@ resources = gnome.compile_resources ('org.gnome.Boxes',
                                      resource_files,
                                      c_name: 'resources')
 
-custom_target ('desktop-file',
-              input: 'org.gnome.Boxes.desktop.in',
-              output: 'org.gnome.Boxes.desktop',
-              install: true,
-              install_dir: join_paths (data_dir, 'applications'),
-              command: [msgfmt, '--desktop', '-d', '../po', '--template', '@INPUT@', '-o', '@OUTPUT@'])
+i18n.merge_file ('desktop-file',
+  type: 'desktop',
+  input: 'org.gnome.Boxes.desktop.in',
+  output: 'org.gnome.Boxes.desktop',
+  po_dir: po_dir,
+  install: true,
+  install_dir: join_paths (data_dir, 'applications')
+)
 
 dbus_conf = configuration_data ()
 dbus_conf.set ('bindir', join_paths (get_option ('prefix'), get_option ('bindir')))
@@ -31,12 +33,12 @@ configure_file (
   install_dir: join_paths (data_dir, 'dbus-1', 'services')
 )
 
-custom_target ('appdata-file',
+i18n.merge_file ('appdata-file',
   input: 'org.gnome.Boxes.appdata.xml.in',
   output: 'org.gnome.Boxes.appdata.xml',
+  po_dir: po_dir,
   install: true,
-  install_dir: join_paths (data_dir, 'metainfo'),
-  command: [ msgfmt, '--xml', '--template', '@INPUT@', '-d', po_dir, '-o', '@OUTPUT@' ],
+  install_dir: join_paths (data_dir, 'metainfo')
 )
 
 configure_file (
diff --git a/meson.build b/meson.build
index 7e7b1bd..dbbe949 100644
--- a/meson.build
+++ b/meson.build
@@ -53,8 +53,6 @@ libgd = subproject (
 libgd_vapi_dep = libgd.get_variable ('libgd_vapi_dep')
 libgd_dep = libgd.get_variable('libgd_dep')
 
-msgfmt = find_program ('msgfmt')
-
 po_dir = join_paths (meson.source_root (), 'po')
 data_dir = join_paths (get_option ('prefix'), get_option ('datadir'))
 locale_dir = join_paths (data_dir, '/locale')


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