aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Pavlik <rpavlik@iastate.edu>2011-10-28 16:59:28 (GMT)
committerRyan Pavlik <rpavlik@iastate.edu>2011-10-31 15:41:32 (GMT)
commitf47ed1be51b079d9616b4d93a4181c89f3006d73 (patch)
tree3e319667cf4d3f456f28a24bfbb8f83bcbf23cac /src
parent1ba4fbe8785a7acf3c4cab6de556929e8f5375b9 (diff)
downloadfluxbox-f47ed1be51b079d9616b4d93a4181c89f3006d73.zip
fluxbox-f47ed1be51b079d9616b4d93a4181c89f3006d73.tar.bz2
FbTk/I18n.cc: Constructor should also check defined(NLS)
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/I18n.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/FbTk/I18n.cc b/src/FbTk/I18n.cc
index 81ff078..3daa2e9 100644
--- a/src/FbTk/I18n.cc
+++ b/src/FbTk/I18n.cc
@@ -72,17 +72,17 @@ void NLSInit(const char *catalog) {
72 72
73 73
74I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)(-1)) { 74I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)(-1)) {
75#ifdef HAVE_SETLOCALE 75#if defined(HAVE_SETLOCALE) && defined(NLS)
76 //make sure we don't get 0 to m_locale string 76 //make sure we don't get 0 to m_locale string
77 char *temp = setlocale(LC_MESSAGES, ""); 77 char *temp = setlocale(LC_MESSAGES, "");
78 m_locale = ( temp ? temp : ""); 78 m_locale = ( temp ? temp : "");
79 if (m_locale.empty()) { 79 if (m_locale.empty()) {
80 cerr<<"Warning: Failed to set locale, reverting to \"C\""<<endl; 80 cerr<<"Warning: Failed to set locale, reverting to \"C\""<<endl;
81#endif // HAVE_SETLOCALE 81#endif // defined(HAVE_SETLOCALE) && defined(NLS)
82 82
83 m_locale = "C"; 83 m_locale = "C";
84 84
85#ifdef HAVE_SETLOCALE 85#if defined(HAVE_SETLOCALE) && defined(NLS)
86 86
87 } else { 87 } else {
88 88
@@ -102,7 +102,7 @@ I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)
102 if (index != string::npos) 102 if (index != string::npos)
103 m_locale.erase(0,index+1); //erase all characters starting up to index 103 m_locale.erase(0,index+1); //erase all characters starting up to index
104 } 104 }
105#endif // HAVE_SETLOCALE 105#endif // defined(HAVE_SETLOCALE) && defined(NLS)
106} 106}
107 107
108 108