question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

i18n module only checks for gettext and misses xgettext

See original GitHub issue

Describe the bug We have a configure file in our build that uses i18n.merge_file. In the users log we saw

Program gettext found: YES (/usr/bin/gettext)

But when Meson reached the i18n.merge_file this error was spit out.

WARNING: Gettext not found, all translation targets will be ignored.

To Reproduce

It took some time to figure out, but the user is on Debian stable, but the issue was that they had gettext-base installed that contains /usr/bin/gettext but xgettext that i18n.merge_file requires is actually in the gettext package.

Expected behavior

It would have been awesome if when detecting the gettext binary, meson would check for xgettext as well if i18n.merge_file is in use. If it couldn’t find it, it would be much nicer if it would mention the executable it was looking for as I had to dig through the meson source to figure out what it was complaining about as the user already verified that they had /usr/bin/gettext installed.

system parameters

The user was on Debian stable with meson 0.56.2, but their system isn’t relevant here out side of the gettext-base was installed but gettext was not installed scenario.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
eli-schwartzcommented, Mar 6, 2022

I opened a PR which fixes this in two ways:

  • it actually checks for each tool which is actually used, and logs whether it is found. The WARNING: Gettext not found [...] is still printed, but immediately beforehand it also mentions the exact tool name it is looking for, so that should presumably be easy to interpret.
  • merge_file is actually required to work now, because it’s unreasonable to expect it to be able to be disabled.
0reactions
inigomartinezcommented, Mar 6, 2022

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

GNU gettext utilities
Users achieve localization of programs by setting proper values to special environment variables, prior to executing those programs, identifying which locale ...
Read more >
meson/i18n-module.md at master - GitHub
i18n.gettext(). Sets up gettext localisation so that translations are built and placed into their proper locations during install. Takes one positional argument ...
Read more >
Introduction to the gettext Tools for Internationalization (i18n)
Extracting POT files with xgettext. The xgettext program finds and extract all marked translatable strings, and creates a PO template file out ...
Read more >
gettext — Multilingual internationalization services — Python ...
The gettext module provides internationalization (I18N) and localization (L10N) services for your Python modules and applications. It supports both the GNU ...
Read more >
PHP i18n Internationalization Tutorial - CodeSamplez.com
Basically only restriction from PHP side is that you need to have the 'gettext' module installed. If you are using a development bundle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found