[gnome-builder] build: Modernize i18n usage



commit a27aebd3e1d83583e54ca272dd309af0a0c3d079
Author: Patrick Griffis <tingping tingping se>
Date:   Wed Jun 14 22:27:59 2017 -0400

    build: Modernize i18n usage

 data/meson.build |   15 +++++----------
 meson.build      |    1 +
 po/meson.build   |    2 --
 3 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 6e8ce31..4882db1 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,26 +1,21 @@
-msgfmt = find_program('msgfmt')
-podir = join_paths(meson.source_root(), 'po')
 
 # Desktop launcher and description file.
-custom_target(
-  'desktop-file',
+i18n.merge_file(
   input: 'org.gnome.Builder.desktop.in.in',
   output: 'org.gnome.Builder.desktop',
+  type: 'desktop',
+  po_dir: '../po',
   install: true,
   install_dir: join_paths(get_option('datadir'), 'applications'),
-  command: [msgfmt, '--desktop', '--template', '@INPUT@',
-    '-d', podir, '-o', '@OUTPUT@'],
 )
 
 # Appdata file.
-custom_target(
-  'appdata-file',
+i18n.merge_file(
   input: 'org.gnome.Builder.appdata.xml.in',
   output: 'org.gnome.Builder.appdata.xml',
+  po_dir: '../po',
   install: true,
   install_dir: join_paths(get_option('datadir'), 'appdata'),
-  command: [msgfmt, '--xml', '--template', '@INPUT@',
-    '-d', podir, '-o', '@OUTPUT@'],
 )
 
 # D-Bus service file.
diff --git a/meson.build b/meson.build
index 2285b28..1fa6f4d 100644
--- a/meson.build
+++ b/meson.build
@@ -220,6 +220,7 @@ if get_option('with_flatpak') or get_option('with_git')
 endif
 
 gnome = import('gnome')
+i18n = import('i18n')
 
 subdir('data')
 subdir('data/fonts')
diff --git a/po/meson.build b/po/meson.build
index 2da1bba..ddf9cc0 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -1,5 +1,3 @@
-i18n = import('i18n')
-
 i18n.gettext('gnome-builder',
   preset: 'glib',
   args: [


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