aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/i18n.py
AgeCommit message (Collapse)AuthorFilesLines
2021-02-05run_target: Add env kwargXavier Claessens1-3/+3
Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
2021-01-30Fix executable as script on WindowsXavier Claessens1-1/+1
On Windows this would fail because of missing DLL: ``` mylib = library(...) exe = executable(..., link_with: mylib) meson.add_install_script(exe) ``` The reason is on Windows we cannot rely on rpath to find libraries from build directory, they are searched in $PATH. We already have all that mechanism in place for custom_target() using ExecutableSerialisation class, so reuse it for install/dist/postconf scripts too. This has bonus side effect to also use exe_wrapper for those scripts. Fixes: #8187
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-1/+1
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2020-03-05Remove some uses of mesonlib.run_onceDylan Baker1-3/+2
These are basically doing what mlog.log(..., once=True) does, so lets just use that. The once argument to mlog is newer, so these probably should have been changed already.
2019-09-25Add helper to print warnings onceZbigniew Jędrzejewski-Szmek1-8/+5
The helper is general, although in this patch it is only used for warnings. No functional change intended.
2019-08-04Make gettext targets no-ops if gettext is not installed. Closes: #821.Jussi Pakkanen1-2/+14
2019-04-22i18n: add args keyword to merge_fileKonstantin1-1/+6
* i18n: add args keyword to merge_file * i18n: add testcase to msgfmt args
2019-03-14i18n: Use CustomTarget.known_kwargs at permittedKwargs()Georges Basile Stavracas Neto1-2/+1
@permittedKwargs() is basically copying the logic of CustomTarget, but it is not actually up to date, leading to warnings on perfectly valid values such as 'build_by_default'. Use CustomTarget.known_kwargs instead, and only append the specific kwargs of i18n.merge_file(). Fixes https://github.com/mesonbuild/meson/issues/5079
2019-02-16i18n: Catch additional GLib functionsFrediano Ziglio1-0/+8
Add some missing functions having C-format strings to the list. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2019-01-26Add install_dir to i18n.gettextSergey Shatunov1-2/+4
2018-10-29Fix merge file using an array. Closes #4424.Jussi Pakkanen1-0/+4
2018-10-24Fix flake8 whitespace reportsJon Turney1-1/+1
$ flake8 | grep -E '(E128|E203|E221|E226|E303|W291|W293)' ./mesonbuild/backend/backends.py:32:1: E303 too many blank lines (3) ./mesonbuild/modules/i18n.py:90:56: E128 continuation line under-indented for visual indent
2018-10-06i18n: replace path separator with @Marty E. Plummer1-1/+1
using state.subdir will cause / or \ to be inserted into the target name. Replace them with @ to future-proof it. Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
2018-10-05Fix handling generated .desktop files. Closes #4304.Jussi Pakkanen1-10/+12
2018-09-16i18n: allow custom target names for merge_fileMarty E. Plummer1-1/+1
As it currently stands, if for whatever reason you have two files you want to merge with the same output name, it will fail due to multiple targets with the same name due to the target name being autogenerated from the output kwarg. Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
2018-09-03i18n: respect variable substitution for the target name when merging ↵Corentin Noël1-1/+13
translations Previously it wasn't possible to use twice @BASENAME@ as the targets would then be named @BASENAME@_merge
2018-06-01Add 0.37.0 featuresSalamandar1-1/+3
2018-04-15Updated all modules to work with the new API.Jussi Pakkanen1-2/+2
2017-10-31namespace run_targets by subprojectMartin Kelly1-4/+4
Currently, run_target does not get namespaced for each subproject, unlike executable and others. This means that two subprojects sharing the same run_target name cause meson to crash. Fix this by moving the subproject namespacing logic from the BuildTarget class to the Target class.
2017-09-22Merge pull request #2357 from LukeShu/flake8Jussi Pakkanen1-4/+5
Bring into compliance with flake8
2017-09-21flake8: Clean up complained-about unused importsLuke Shumaker1-2/+1
This also adds a "# noqa: F401" comment on an unused "import lzma", which we are using it in a try/except block that is being used to check if the lzma module is importable; of course it is unused. v2: This turned out to be a little tricky. mesonbuild/modules/__init__.py had the "unused" import: from ..interpreterbase import permittedKwargs, noKwargs However, that meant that the various modules could do things like: from . import noKwargs # "." is "mesonbuild.modules" Which breaks when you remove __init__.py's "unused" import. I could have tagged that import with "# noqa: F401", but instead I chose to have each of the module import directly from "..interpreterbase" instead of ".".
2017-09-21flake8: Perform suggested whitespace/formatting changesLuke Shumaker1-2/+4
This only touches newlines, spaces, and (occaisionally) commas. Anything else is left for another commit.
2017-09-20Change ternary to another argumentCorentin Noël1-1/+1
2017-09-20Add 'install' keyword to the gettext macroCorentin Noël1-11/+16
2017-08-18Make all functionality invokable via the main Meson binary,Jussi Pakkanen1-8/+8
which can be a Windows .exe file.
2017-07-20i18n: Fixed gettext permitted Kwargs listIñigo Martínez1-1/+1
2017-06-26Fixed issues raised in review.Jussi Pakkanen1-3/+3
2017-06-26Converted some modules.Jussi Pakkanen1-0/+4
2017-04-29i18n: Fix handling relative data_dirsPatrick Griffis1-2/+8
2017-04-29i18n: Add data_dirs kwarg to merge_file()Patrick Griffis1-2/+9
For parity with gettext() Fixes #1565
2017-01-09There are two different kinds of extensions: modules that create newJussi Pakkanen1-4/+5
objects directly and snippets that just call into interpreter methods.
2017-01-06Fix a few more modules.Jussi Pakkanen1-2/+5
2017-01-03Merge pull request #1272 from mesonbuild/ignatenko/lintJussi Pakkanen1-1/+1
fix some linting errors
2017-01-03Error out if trying to do gettext without appropriate tools.Jussi Pakkanen1-0/+3
2017-01-02style: fix E241 violationsIgor Gnatenko1-1/+1
E241: multiple spaces after ',' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-21Merge pull request #1233 from mesonbuild/wip/ignatenko/code-styleJussi Pakkanen1-1/+1
Trivial cleanups in code
2016-12-20Cache the scripts used for postconf and install phasesNirbheek Chauhan1-1/+1
Cache the absolute dir that the script is searched in and the name of the script. These are the only two things that change. Update the test to test for both #1235 and the case when a script of the same name is in a different directory (which also covers the subproject case). Closes #1235
2016-12-19tree-wide: use proper 'not in' notationIgor Gnatenko1-1/+1
Let's be more pythonic and 'not is' seems really weird. Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18Allow passing arguments to install scriptsNirbheek Chauhan1-7/+7
Closes #1213
2016-12-06i18n: Improve language handlingPatrick Griffis1-16/+11
- Fix LINGUAS changes not being picked up - Fix multiple langs per line in LINGUAS - Make empty languages acceptable Fixes #1127
2016-12-03i18n: Add preset kwargPatrick Griffis1-0/+34
Many frameworks, such as glib, provide translation functions and functions that take format strings. As such every application using these must duplicate the gettext arguments to function properly. This reduces that duplication and improves correctness so they are not left out. Fixes #1123
2016-12-03i18n: Add merge_file functionPatrick Griffis1-0/+16
This is a repeated task that we can simplify Closes #1120
2016-12-02i18n: Read languages from LINGUAS filePatrick Griffis1-1/+11
This avoids duplicating a list and allows the translation maintainers to not have to modify the build system. Mentioned in #1115
2016-11-02gettext: Use argparse to handle argumentsPatrick Griffis1-17/+24
2016-10-23gettext: Add update-po targetPatrick Griffis1-1/+7
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
2016-10-16gettext: Add ability to set GETTEXTDATADIRSPatrick Griffis1-1/+5
Some projects use this to allow using local its files
2016-06-24Changed run_target to take command as kwarg and add depends. This makes it ↵Jussi Pakkanen1-2/+2
behave the same as custom_target.
2016-05-26Can pass extra args to xgettext. Closes #554.Jussi Pakkanen1-1/+2
2016-05-21Remove all special casing for gettext and use elementary operations instead.Jussi Pakkanen1-1/+16
2016-03-28Moved gettext into i18n module.Jussi Pakkanen1-0/+29