What does the "_" function in Vala do?

function, vala

Solution

That is the GNU `gettext` localization function. You can provide language specific alternate strings for the one specified in the function call.

There is the `xgettext` tool, which generates a `.pot` file (abbreviation for portable object template) from your application code, then translators can make `.po` localization files for it. Then, you can bundle these with your application, and deliver a more widely usable piece of software.

Problem

I've seen that some projects used `_` function that takes string as an argument, like `_("Hello World")`. But I couldn't find any manuals or articles about what is it and how to use it. I guess this has something to do with i18n and l10n (it was mentioned in some article I found on the internet), but can you explain to me how it works and how to use it?

Original source

Related problems