We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88d091f commit fd247d5Copy full SHA for fd247d5
src/gettext.h
@@ -51,10 +51,19 @@ extern wchar_t *utf8_to_wide_c(const char *str);
51
// The returned string is allocated using new
52
inline const wchar_t *wgettext(const char *str)
53
{
54
- return utf8_to_wide_c(gettext(str));
+#if USE_GETTEXT
55
+ // We must check here that is not an empty string to avoid trying to translate it
56
+ return str[0] ? utf8_to_wide_c(gettext(str)) : utf8_to_wide_c("");
57
+#else
58
+ return utf8_to_wide_c(str);
59
+#endif
60
}
61
62
inline std::string strgettext(const std::string &text)
63
- return gettext(text.c_str());
64
65
+ return text.empty() ? text.c_str() : gettext(text.c_str());
66
67
+ return text.c_str();
68
69
0 commit comments