[gnome-usage] build: Use i18n module for AppData translation
- From: Petr Štětka <pstetka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] build: Use i18n module for AppData translation
- Date: Thu, 21 Dec 2017 17:29:45 +0000 (UTC)
commit 2f0b1799007971c928f0c7da5d0ba95562113bca
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Wed Dec 20 12:53:41 2017 +0100
build: Use i18n module for AppData translation
The i18n module is used for processing translations in the `po`
directory. However, it can also be used to merge translations.
The use of the i18n module has been extended to merge translations
to the AppData file.
data/meson.build | 13 +++++++------
meson.build | 2 +-
po/meson.build | 1 -
3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 3e5e0bf..02183d1 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -15,10 +15,11 @@ install_data('icons/32x32/org.gnome.Usage.png', install_dir: join_paths([get_opt
install_data('icons/48x48/org.gnome.Usage.png', install_dir: join_paths([get_option('datadir'),
'icons/hicolor/48x48/apps']))
install_data('icons/512x512/org.gnome.Usage.png', install_dir: join_paths([get_option('datadir'),
'icons/hicolor/512x512/apps']))
-custom_target('appdata-file',
- input: 'org.gnome.Usage.appdata.xml.in',
- output: 'org.gnome.Usage.appdata.xml',
- install: true,
- install_dir: join_paths(get_option('datadir'), 'metainfo'),
- command: [ msgfmt, '--xml', '--template', '@INPUT@', '-d', po_dir, '-o', '@OUTPUT@' ],
+i18n.merge_file(
+ 'appdata-file',
+ input: 'org.gnome.Usage.appdata.xml.in',
+ output: 'org.gnome.Usage.appdata.xml',
+ po_dir: po_dir,
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'metainfo')
)
diff --git a/meson.build b/meson.build
index 97a1f6e..b131898 100644
--- a/meson.build
+++ b/meson.build
@@ -15,7 +15,7 @@ gtop = dependency('libgtop-2.0', version : '>=2.34.0')
accountsservice = dependency('accountsservice', version: '>= 0.6.40')
math = cc.find_library('m')
-msgfmt = find_program('msgfmt')
+i18n = import('i18n')
po_dir = join_paths(meson.source_root(), 'po')
diff --git a/po/meson.build b/po/meson.build
index 94fc363..7ccc5fa 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -1,2 +1 @@
-i18n = import('i18n')
i18n.gettext('gnome-usage', preset: 'glib')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]