_ is a macro often used with the GNU gettext package .
GNU gettext is a package that:
- accepts lists of message lines intended for reading by people, and translations of these lines into other languages ββand compiles them into databases;
- provides a routine called
gettext() to search for message strings in this database and return a translation for a message in a specific language.
If the program was asked to print the message in the language selected by the user in the environment variable and picked up by the setlocale() call, he would usually do something like
fprintf(stderr, gettext("I cannot open the file named %s\n"), filename);
gettext() will search for the appropriate line feed "I cannot find the file named %s\n" in the database and return the translated line.
However, this is a bit uncomfortable; as documentation for GNU gettext notes , many programs use a macro to make only the _( string ) alias for the gettext( ) string.
user862787
source share