What does printf (_ ("hello, world \ n")) mean?

What is the role of the argument _ ("hello, world \ n") for printf / puts, etc.? I often find it when reading the GNU source code.

+7
c gnu
source share
4 answers

See GNU Gettext - it ( _(...) ) is used as a "binding site" for translation.

+9
source share

This is the gettext internationalization system.

+6
source share

this is a macro that replaces the gettext translation function. For a detailed explanation in gettext, check out this entry: http://oriya.sarovar.org/docs/gettext_single.html

+5
source share

The underline function (or macro) is a custom function defined by any project you are looking at. By convention, he decided to send the GNU Gettext string to get a translated version of the string for the user's current language.

This use of the _ macro is described in the overview , which is contained in the GNU Gettext manual.

+3
source share

All Articles