In C code I came across this bit
_("test")
What does it do? (I tried to look it up myself, but as you can imagine, search engines do not support searching for that...)
It is calling the function called _
. For instance:
#include <stdio.h>
void _(int a) {
printf("%d",a);
}
int main(void) {
_(3);
return 0;
}
_
is an existing function in gettext library and is used for internationalization. As said in this answer:
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With