[json-glib] build: Use Meson's i18n 'glib' preset



commit 1a0eeb7db59589fe56893b0836f406d723f8553c
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Jun 3 12:34:50 2017 +0100

    build: Use Meson's i18n 'glib' preset
    
    We should simplify the localisation build by using the 'glib' preset
    provided by the Meson i18n module. This includes:
    
     - getting the list of localisations from the po/LINGUAS file
     - a full list of translatable keywords and flags
    
    Which means we can drop almost all content from the po/meson.build file
    and just use the upstream settings.

 meson.build    |    2 +-
 po/LINGUAS     |   52 +++++++++++++++++++++++++++++++++++
 po/Makevars    |    6 +++-
 po/meson.build |   82 +-------------------------------------------------------
 4 files changed, 58 insertions(+), 84 deletions(-)
---
diff --git a/meson.build b/meson.build
index 5c6c6b1..8c6d176 100644
--- a/meson.build
+++ b/meson.build
@@ -4,7 +4,7 @@ project('json-glib', 'c', version: '1.3.1',
           'warning_level=1',
           'buildtype=debugoptimized',
         ],
-        meson_version: '>= 0.38.1')
+        meson_version: '>= 0.40.1')
 
 
 # Versionning
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..172e584
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,52 @@
+as
+bg
+bn_IN
+bs
+ca
+ca@valencia
+cs
+da
+de
+el
+en_GB
+eo
+es
+et
+eu
+fr
+fur
+gl
+he
+hi
+hu
+id
+it
+ja
+ko
+ky
+lt
+lv
+ml
+nb
+oc
+or
+pa
+pl
+pt_BR
+pt
+ro
+ru
+sk
+sl
+sr@latin
+sr
+sv
+te
+tg
+tr
+ug
+uk
+vi
+zh_CN
+zh_HK
+zh_TW
diff --git a/po/Makevars b/po/Makevars
index fe36f8b..23342d8 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -1,7 +1,9 @@
 DOMAIN = json-glib-1.0
-XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 
--keyword=g_dngettext:2,3 --keyword=P_ --add-comments
-COPYRIGHT_HOLDER = Intel Corporation
+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 
--keyword=g_dngettext:2,3 --add-comments
+COPYRIGHT_HOLDER = Intel Corporation and others
 MSGID_BUGS_ADDRESS = http://bugzilla.gnome.org/enter_bug.cgi?product=json-glib
 EXTRA_LOCALE_CATEGORIES =
+PACKAGE_GNU = no
 
+subdir = po
 top_builddir = ..
diff --git a/po/meson.build b/po/meson.build
index f6bdacf..d6af0ce 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -1,83 +1,3 @@
 i18n = import('i18n')
 
-langs = [
-  'as',
-  'bg',
-  'bn_IN',
-  'bs',
-  'ca',
-  'ca@valencia',
-  'cs',
-  'da',
-  'de',
-  'el',
-  'en_GB',
-  'eo',
-  'es',
-  'et',
-  'eu',
-  'fr',
-  'fur',
-  'gl',
-  'he',
-  'hi',
-  'hu',
-  'id',
-  'it',
-  'ja',
-  'ko',
-  'ky',
-  'lt',
-  'lv',
-  'ml',
-  'nb',
-  'oc',
-  'or',
-  'pa',
-  'pl',
-  'pt_BR',
-  'pt',
-  'ro',
-  'ru',
-  'sk',
-  'sl',
-  'sr@latin',
-  'sr',
-  'sv',
-  'te',
-  'tg',
-  'tr',
-  'ug',
-  'uk',
-  'vi',
-  'zh_CN',
-  'zh_HK',
-  'zh_TW',
-]
-
-i18n.gettext('json-glib-1.0',
-             languages: langs,
-             args: [
-               '--default-domain=' + meson.project_name(),
-               '--from-code=UTF-8',
-               '--add-comments',
-               '--msgid-bugs-address=https://bugzilla.gnome.org/enter_bug.cgi?product=json-glib',
-
-               '--keyword=_',
-               '--keyword=N_',
-               '--keyword=C_:1c,2',
-               '--keyword=NC_:1c,2',
-               '--keyword=g_dcgettext:2',
-               '--keyword=g_dngettext:2,3',
-               '--keyword=g_dpgettext2:2c,3',
-
-               '--flag=N_:1:pass-c-format',
-               '--flag=C_:2:pass-c-format',
-               '--flag=NC_:2:pass-c-format',
-               '--flag=g_dngettext:2:pass-c-format',
-               '--flag=g_strdup_printf:1:c-format',
-               '--flag=g_string_printf:2:c-format',
-               '--flag=g_string_append_printf:2:c-format',
-               '--flag=g_error_new:3:c-format',
-               '--flag=g_set_error:4:c-format',
-             ])
+i18n.gettext('json-glib-1.0', preset: 'glib')


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