开发者

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

This question already has answers here: 开发者_C百科 Underscore `_` before the format string (3 answers) Closed 3 years ago.

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


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


This is the gettext internationalization system.


it is a macro that replaces the gettext translation function. For a thorough explanation on gettext, check out this write-up: http://oriya.sarovar.org/docs/gettext_single.html


The underscore function (or macro) is a custom function defined by whatever project you're looking at. By convention, it's defined to send the string to GNU Gettext to fetch a translated version of the string for the user's current language.

This use of the _ macro is documented in the overview found in the GNU Gettext manual.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜