diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-05-16 22:35:59 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-05-16 22:35:59 +0000 |
| commit | ae3dc273c4b42553208d230a775731df18058a4a (patch) | |
| tree | 5c453fa256527c42865486203f94001f95ad4f59 /src/i18n.h | |
| parent | 30136ab3e948318ae5171de2a0f71358dbcb9f3a (diff) | |
new i18n class using overloaded operator() instead of getMessage()
Diffstat (limited to 'src/i18n.h')
| -rw-r--r-- | src/i18n.h | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -1,5 +1,6 @@ -// i18n.h for Openbox -// Copyright (c) 2001 Sean 'Shaleh' Perry <shaleh@debian.org> +// -*- mode: C++; indent-tabs-mode: nil; -*- +// i18n.hh for Openbox +// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry <shaleh@debian.org> // 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 <locale.h> #endif // HAVE_LOCALE_H #ifdef HAVE_NL_TYPES_H -extern "C" { # include <nl_types.h> -} #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 |
