}
#include <string>
-using std::string;
#include "i18n.h"
}
-void I18n::openCatalog(const char *catalog) {
#if defined(NLS) && defined(HAVE_CATOPEN)
- string catalog_filename = LOCALEPATH;
+void I18n::openCatalog(const char *catalog) {
+ std::string catalog_filename = LOCALEPATH;
catalog_filename += '/';
catalog_filename += locale;
catalog_filename += '/';
if (catalog_fd == (nl_catd) -1)
fprintf(stderr, "failed to open catalog, using default messages\n");
-#endif // HAVE_CATOPEN
}
+#else
+void I18n::openCatalog(const char *) {
+}
+#endif // HAVE_CATOPEN
-const char* I18n::operator()(int set, int msg, const char *msgString) const {
#if defined(NLS) && defined(HAVE_CATGETS)
+const char* I18n::operator()(int set, int msg, const char *msgString) const {
if (catalog_fd != (nl_catd) -1)
return catgets(catalog_fd, set, msg, msgString);
else
-#endif
return msgString;
}
+#else
+const char* I18n::operator()(int, int, const char *msgString) const {
+ return msgString;
+}
+#endif