X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fi18n.cc;h=718ee4e733474e5b6f43839214042afbeb3a899f;hb=bbbe226ccc7086721ba5e652fa89e6e8190adb56;hp=b8aa361a45f7eec351e905e28ea39dff7b1418b9;hpb=ae3dc273c4b42553208d230a775731df18058a4a;p=chaz%2Fopenbox diff --git a/src/i18n.cc b/src/i18n.cc index b8aa361a..718ee4e7 100644 --- a/src/i18n.cc +++ b/src/i18n.cc @@ -46,7 +46,6 @@ extern "C" { } #include -using std::string; #include "i18n.h" @@ -87,9 +86,9 @@ I18n::~I18n() { } -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 += '/'; @@ -103,14 +102,21 @@ void I18n::openCatalog(const char *catalog) { 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