强调功能 [英] Underscore function
问题描述
我在这里看一些C源$ C $ c和我发现这一点:
I'm here looking at some C source code and I've found this:
fprintf(stderr, _("Try `%s --help' for more information.\n"), command);
我已经看到了下划线,当我在wxWidget一看,和我读它用于国际化。我发现它真的很可怕(最少intutive名话),但我因子评分它只是一个奇怪的wxWidget约定。
I already saw the underscore when I had a look at wxWidget, and I read it's used for internationalization. I found it really horrible (the least intutive name ever), but I tought it's just another weird wxWidget convention.
现在我在一些艾莎源再次找到它。有谁知道它来自哪里?
Now I find it again in some Alsa source. Does anyone know where it comes from?
推荐答案
它来自GNU 的gettext
,包旨在缓解国际化进程。在 _()
函数只是一个字符串包装。这个功能基本上取代了运行时给定的字符串与系统的语言翻译,如果有的话(即,如果他们运了的.mo
文件中查找该语言与程序)。
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).
这篇关于强调功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!