Underscore `_` before the format string

前端 未结 3 594
刺人心
刺人心 2020-11-30 12:12

I\'m here looking at some C source code and I\'ve found this:

fprintf(stderr, _(\"Try `%s --help\' for more information.\\n\"), command);

I

3条回答
  •  执笔经年
    2020-11-30 12:51

    It comes from GNU gettext, a package designed to ease the internationalization process. The _() function is simply a string wrapper. This function basically replaces the given string on runtime with a translation in the system's language, if available (i.e. if they shipped a .mo file for this language with the program).

提交回复
热议问题