[gnome-boxes] meson: Use meson's i18n module



commit 1b3fb58ad938482ee7132513740589772fe382be
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 d9257fe..9f1c4b4 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')
 )
 
 gsettings_conf = configuration_data ()
diff --git a/meson.build b/meson.build
index 67eb5b8..1f91351 100644
--- a/meson.build
+++ b/meson.build
@@ -21,8 +21,6 @@ config_dep = valac.find_library ('config', dirs: src_dir)
 
 pkglibdir = join_paths (get_option ('libdir'), meson.project_name ())
 
-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 (get_option ('prefix'), get_option ('localedir'))


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