bind_textdomain_codeset("messages", 'UTF-8');
where "messages" is the text domain that was bound with the textdomain command.
Stupidly difficult bug to tackle.
bind_textdomain_codeset("messages", 'UTF-8');
bindtextdomain('hello', '/usr/share/locale')
textdomain('hello')
return _('this string is to be translated');3. Extract the strings using the xgettext utility.
xgettext -d hello -s -o hello.pot hello.c4. Turn the .pot file into a .po file that can be passed on to the translators
msginit -l es_US -o spanish.po -i hello.pot5. Translate the strings in the .po file
6. Convert the .po file into a compiled .mo using the msgfmt utility, note that the output filename must match the domain given as the first argument to bindtextdomain and textdomain and must be placed in the location specified as the second argument to bindtextdomainmsgid "Hello\n"
msgstr "Hola\n"
msgfmt -c -v -o hello.mo spanish.posource
cp hello.mo /usr/share/locale/es_US/LC_MESSAGES