aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/I18n.hh
diff options
context:
space:
mode:
authorsimonb <simonb>2006-06-21 14:41:16 (GMT)
committersimonb <simonb>2006-06-21 14:41:16 (GMT)
commit3ada3b1f0d6d2debaaab48eecf828a406e964c8e (patch)
tree3c2f02462317408ee8604d0c7bb41092ecfd1c3a /src/FbTk/I18n.hh
parent62a298b0b30aa5b4990f462aece224e09e4fafe6 (diff)
downloadfluxbox_pavel-3ada3b1f0d6d2debaaab48eecf828a406e964c8e.zip
fluxbox_pavel-3ada3b1f0d6d2debaaab48eecf828a406e964c8e.tar.bz2
fix nls... notably classify text on conversion whether its for X or
console, plus handle catalogs better.
Diffstat (limited to 'src/FbTk/I18n.hh')
-rw-r--r--src/FbTk/I18n.hh36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/FbTk/I18n.hh b/src/FbTk/I18n.hh
index cbf241d..9a936d8 100644
--- a/src/FbTk/I18n.hh
+++ b/src/FbTk/I18n.hh
@@ -68,20 +68,36 @@ void catclose(nl_catd cat);
68 FbTk::I18n &i18n = *FbTk::I18n::instance() 68 FbTk::I18n &i18n = *FbTk::I18n::instance()
69 69
70// ignore the description, it's for helping translators 70// ignore the description, it's for helping translators
71#define _FBTEXT(msgset, msgid, default_text, description) \ 71
72 i18n.getMessage(FBNLS::msgset ## Set, FBNLS::msgset ## msgid, default_text) 72// Text for X
73 73#define _FB_XTEXT(msgset, msgid, default_text, description) \
74 i18n.getMessage(FBNLS::msgset ## Set, FBNLS::msgset ## msgid, default_text, true)
75
76// Text for console
77#define _FB_CONSOLETEXT(msgset, msgid, default_text, description) \
78 i18n.getMessage(FBNLS::msgset ## Set, FBNLS::msgset ## msgid, default_text, false)
79
74// This ensure that FbTk nls stuff is in a kind of namespace of its own 80// This ensure that FbTk nls stuff is in a kind of namespace of its own
75#define _FBTKTEXT( msgset, msgid, default_text, description) \ 81#define _FBTK_XTEXT( msgset, msgid, default_text, description) \
76 i18n.getMessage(FBNLS::FbTk ## msgset ## Set, FBNLS::FbTk ## msgset ## msgid, default_text) 82 i18n.getMessage(FBNLS::FbTk ## msgset ## Set, FBNLS::FbTk ## msgset ## msgid, default_text, true)
83
84#define _FBTK_CONSOLETEXT( msgset, msgid, default_text, description) \
85 i18n.getMessage(FBNLS::FbTk ## msgset ## Set, FBNLS::FbTk ## msgset ## msgid, default_text, false)
77 86
78#else // no NLS 87#else // no NLS
79 88
80#define _FB_USES_NLS 89#define _FB_USES_NLS
81#define _FBTEXT(msgset, msgid, default_text, description) \ 90
91#define _FB_XTEXT(msgset, msgid, default_text, description) \
82 std::string(default_text) 92 std::string(default_text)
83 93
84#define _FBTKTEXT(msgset, msgid, default_text, description) \ 94#define _FB_CONSOLETEXT(msgset, msgid, default_text, description) \
95 std::string(default_text)
96
97#define _FBTK_XTEXT(msgset, msgid, default_text, description) \
98 std::string(default_text)
99
100#define _FBTK_CONSOLETEXT(msgset, msgid, default_text, description) \
85 std::string(default_text) 101 std::string(default_text)
86 102
87#endif // defined NLS 103#endif // defined NLS
@@ -96,15 +112,17 @@ public:
96 inline const nl_catd &getCatalogFd() const { return m_catalog_fd; } 112 inline const nl_catd &getCatalogFd() const { return m_catalog_fd; }
97 113
98 FbString getMessage(int set_number, int message_number, 114 FbString getMessage(int set_number, int message_number,
99 const char *default_messsage = 0) const; 115 const char *default_messsage = 0, bool translate_fb = false) const;
116
100 void openCatalog(const char *catalog); 117 void openCatalog(const char *catalog);
101private: 118private:
102 I18n(); 119 I18n();
103 ~I18n(); 120 ~I18n();
104 std::string m_locale; 121 std::string m_locale;
105 bool m_multibyte; 122 bool m_multibyte, m_utf8_translate;
106 nl_catd m_catalog_fd; 123 nl_catd m_catalog_fd;
107 124
125
108}; 126};
109 127
110void NLSInit(const char *); 128void NLSInit(const char *);