00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef I18N_HH
00028 #define I18N_HH
00029
00030 #include "../nls/blackbox-nls.hh"
00031
00032 #ifdef HAVE_CONFIG_H
00033 #include "config.h"
00034 #endif // HAVE_CONFIG_H
00035
00036 #ifdef HAVE_LOCALE_H
00037 #include <locale.h>
00038 #endif // HAVE_LOCALE_H
00039
00040 #ifdef HAVE_NL_TYPES_H
00041
00042 extern "C" {
00043 #include <nl_types.h>
00044 }
00045 #endif // HAVE_NL_TYPES_H
00046
00047 #include <string>
00048
00049 class I18n {
00050 public:
00051 static I18n *instance();
00052 inline const char *getLocale() const { return m_locale.c_str(); }
00053 inline bool multibyte() const { return m_multibyte; }
00054 inline const nl_catd &getCatalogFd() const { return m_catalog_fd; }
00055
00056 const char *getMessage(int set_number, int message_number,
00057 const char *default_messsage = 0) const;
00058 void openCatalog(const char *catalog);
00059 private:
00060 I18n();
00061 ~I18n();
00062 std::string m_locale;
00063 bool m_multibyte;
00064 nl_catd m_catalog_fd;
00065
00066 };
00067
00068 void NLSInit(const char *);
00069
00070 #endif // I18N_HH