From ae3dc273c4b42553208d230a775731df18058a4a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 16 May 2002 22:35:59 +0000 Subject: new i18n class using overloaded operator() instead of getMessage() --- src/i18n.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/i18n.h') diff --git a/src/i18n.h b/src/i18n.h index b074b2ff..d8d29a4a 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -1,5 +1,6 @@ -// i18n.h for Openbox -// Copyright (c) 2001 Sean 'Shaleh' Perry +// -*- mode: C++; indent-tabs-mode: nil; -*- +// i18n.hh for Openbox +// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // Permission is hereby granted, free of charge, to any person obtaining a @@ -28,39 +29,35 @@ // add ifdefs to every call to getMessage #include "../nls/openbox-nls.h" +extern "C" { #ifdef HAVE_LOCALE_H # include #endif // HAVE_LOCALE_H #ifdef HAVE_NL_TYPES_H -extern "C" { # include -} #endif // HAVE_NL_TYPES_H +} class I18n { private: - char *locale, *catalog_filename; + char *locale; bool mb; #ifdef HAVE_NL_TYPES_H nl_catd catalog_fd; #endif public: - I18n(void); - ~I18n(void); + I18n(const char *catalog = 0); + ~I18n(); inline bool multibyte(void) const { return mb; } - const char *getMessage(int set, int msg, const char *msgString) const; + const char* operator()(int set, int msg, const char *msgString) const; void openCatalog(const char *catalog); }; - -extern I18n *i18n; -extern void NLSInit(const char *); - - +extern I18n i18n; // located in main.cc #endif // __i18n_h -- cgit v1.2.3