1,234
edits
Changes
→Part 2
<pre>
#include <libintl.h>
#include <locale.h>
int main(void)
{
setlocale( LC_ALL, "" ); //bindtextdomain( "hello", "/usr/share/locale" ); bindtextdomain( "hello", "./locale" ); textdomain( "hello" );
printf( gettext( "Hello, world!\n")); printf("This is how you say 'crazy' in the current language: "); printf(gettext("crazy\n")); printf(gettext("Note that newlines at the end of the translated strings matter\n" ) );
return 0;