diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-09-14 21:35:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-14 21:35:50 +0300 |
commit | 19e22ac88a1e55e3e53035acd1986fea42a22d9d (patch) | |
tree | b88c00fcf808753c80907bbb467818e9fb26b755 | |
parent | 6fd2fab02cf0e282483993b3df0e4388a5d23a02 (diff) | |
parent | 6f1d7e3d0ab541e8f98f7b45551fc8819618c20d (diff) | |
download | meson-19e22ac88a1e55e3e53035acd1986fea42a22d9d.zip meson-19e22ac88a1e55e3e53035acd1986fea42a22d9d.tar.gz meson-19e22ac88a1e55e3e53035acd1986fea42a22d9d.tar.bz2 |
Merge pull request #2216 from ebassi/yelp-linguas
Support LINGUAS for gnome.yelp() languages
-rw-r--r-- | mesonbuild/modules/gnome.py | 5 | ||||
-rw-r--r-- | mesonbuild/scripts/yelphelper.py | 4 | ||||
-rw-r--r-- | test cases/frameworks/13 yelp/help/LINGUAS | 2 | ||||
-rw-r--r-- | test cases/frameworks/13 yelp/help/meson.build | 6 | ||||
-rw-r--r-- | test cases/frameworks/13 yelp/installed_files.txt | 6 |
5 files changed, 23 insertions, 0 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 476f80b..fcdd193 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -680,6 +680,11 @@ class GnomeModule(ExtensionModule): source_str = '@@'.join(sources) langs = mesonlib.stringlistify(kwargs.pop('languages', [])) + if langs: + mlog.log(mlog.red('DEPRECATION:'), '''The "languages" argument of gnome.yelp() is deprecated. +Use a LINGUAS file in the sources directory instead. +This will become a hard error in the future.''') + media = mesonlib.stringlistify(kwargs.pop('media', [])) symlinks = kwargs.pop('symlink_media', True) diff --git a/mesonbuild/scripts/yelphelper.py b/mesonbuild/scripts/yelphelper.py index 978a870..ab99267 100644 --- a/mesonbuild/scripts/yelphelper.py +++ b/mesonbuild/scripts/yelphelper.py @@ -18,6 +18,7 @@ import shutil import argparse from .. import mlog from . import destdir_join +from .gettext import read_linguas parser = argparse.ArgumentParser() parser.add_argument('command') @@ -108,6 +109,9 @@ def run(args): build_subdir = os.path.join(os.environ['MESON_BUILD_ROOT'], options.subdir) abs_sources = [os.path.join(src_subdir, 'C', source) for source in sources] + if not langs: + langs = read_linguas(src_subdir) + if options.command == 'pot': build_pot(src_subdir, options.project_id, sources) elif options.command == 'update-po': diff --git a/test cases/frameworks/13 yelp/help/LINGUAS b/test cases/frameworks/13 yelp/help/LINGUAS new file mode 100644 index 0000000..173f978 --- /dev/null +++ b/test cases/frameworks/13 yelp/help/LINGUAS @@ -0,0 +1,2 @@ +de +es diff --git a/test cases/frameworks/13 yelp/help/meson.build b/test cases/frameworks/13 yelp/help/meson.build index 85bc980..c8edd61 100644 --- a/test cases/frameworks/13 yelp/help/meson.build +++ b/test cases/frameworks/13 yelp/help/meson.build @@ -13,3 +13,9 @@ gnome.yelp('meson-symlink', symlink_media: true, languages: ['de', 'es'], ) + +gnome.yelp('meson-linguas', + sources: 'index.page', + media: 'media/test.txt', + symlink_media: false, +) diff --git a/test cases/frameworks/13 yelp/installed_files.txt b/test cases/frameworks/13 yelp/installed_files.txt index 9fc097d..1f6522f 100644 --- a/test cases/frameworks/13 yelp/installed_files.txt +++ b/test cases/frameworks/13 yelp/installed_files.txt @@ -10,3 +10,9 @@ usr/share/help/es/meson-symlink/media/test.txt usr/share/help/es/meson-symlink/index.page usr/share/help/de/meson-symlink/index.page usr/share/help/de/meson-symlink/media/test.txt +usr/share/help/C/meson-linguas/index.page +usr/share/help/C/meson-linguas/media/test.txt +usr/share/help/es/meson-linguas/media/test.txt +usr/share/help/es/meson-linguas/index.page +usr/share/help/de/meson-linguas/index.page +usr/share/help/de/meson-linguas/media/test.txt |