diff options
author | Patrick Griffis <tingping@tingping.se> | 2016-10-15 20:06:31 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-10-23 08:46:48 -0700 |
commit | 423c8dbb403e432b7985469e2c054d16e84143d9 (patch) | |
tree | a92df6be0efc95ba3ac9c01cc363075cdca54385 /mesonbuild/modules/i18n.py | |
parent | b50f3e6976989e13d0d413b4af1547f5862cdfa9 (diff) | |
download | meson-423c8dbb403e432b7985469e2c054d16e84143d9.zip meson-423c8dbb403e432b7985469e2c054d16e84143d9.tar.gz meson-423c8dbb403e432b7985469e2c054d16e84143d9.tar.bz2 |
gettext: Add update-po target
For each project this creates a <project>-update-po target.
When ran this updates the pot file and then merges it back
into the po files in the source directory with `msgmerge`
for project maintainers and translators.
Fixes #819
Diffstat (limited to 'mesonbuild/modules/i18n.py')
-rw-r--r-- | mesonbuild/modules/i18n.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py index 00787f8..28e04cb 100644 --- a/mesonbuild/modules/i18n.py +++ b/mesonbuild/modules/i18n.py @@ -33,6 +33,12 @@ class I18nModule: pottarget = build.RunTarget(packagename + '-pot', sys.executable, potargs, [], state.subdir) gmoargs = [state.environment.get_build_command(), '--internal', 'gettext', 'gen_gmo'] + languages gmotarget = build.RunTarget(packagename + '-gmo', sys.executable, gmoargs, [], state.subdir) + updatepoargs = [state.environment.get_build_command(), '--internal', 'gettext', 'update_po', packagename] + updatepoargs.append('@@'.join(languages)) + if datadirs: + updatepoargs.append('--datadirs=' + ':'.join(datadirs)) + updatepoargs += extra_args + updatepotarget = build.RunTarget(packagename + '-update-po', sys.executable, updatepoargs, [], state.subdir) installcmd = [sys.executable, state.environment.get_build_command(), '--internal', @@ -43,7 +49,7 @@ class I18nModule: state.environment.coredata.get_builtin_option('localedir'), ] + languages iscript = build.InstallScript(installcmd) - return [pottarget, gmotarget, iscript] + return [pottarget, gmotarget, iscript, updatepotarget] def initialize(): return I18nModule() |