Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the "_" function in Vala do?

Tags:

function

vala

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?

like image 612
serge1peshcoff Avatar asked Dec 12 '25 13:12

serge1peshcoff


1 Answers

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.

like image 125
meskobalazs Avatar answered Dec 14 '25 05:12

meskobalazs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!