10#include <winpr/build-config.h>
17BOOL winpr_i18n_enable_translation(
const char* locale)
20 const char*
const requested = (locale && (locale[0] !=
'\0')) ? locale :
"";
21 return setlocale(LC_MESSAGES, requested) ? TRUE : FALSE;
28BOOL winpr_i18n_bind_domain(
const char* domain,
const char* searchPath)
30 if (!domain || (domain[0] ==
'\0'))
34 const char* catalogPath = searchPath;
35 if (!catalogPath || (catalogPath[0] ==
'\0'))
36 catalogPath = WINPR_INSTALL_LOCALEDIR;
37 if (catalogPath && (catalogPath[0] !=
'\0') && !bindtextdomain(domain, catalogPath))
39 return bind_textdomain_codeset(domain,
"UTF-8") ? TRUE : FALSE;
41 WINPR_UNUSED(searchPath);
46const char* winpr_i18n_dgettext(
const char* domain,
const char* msgid)
52 if (domain && (domain[0] !=
'\0'))
53 return dgettext(domain, msgid);