diff options
Diffstat (limited to 'src/i18n.hh')
-rw-r--r-- | src/i18n.hh | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/i18n.hh b/src/i18n.hh new file mode 100644 index 0000000..a2b97b9 --- /dev/null +++ b/src/i18n.hh | |||
@@ -0,0 +1,71 @@ | |||
1 | // i18n.hh for Blackbox - an X11 Window manager | ||
2 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) | ||
3 | // | ||
4 | // Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | // copy of this software and associated documentation files (the "Software"), | ||
6 | // to deal in the Software without restriction, including without limitation | ||
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | // and/or sell copies of the Software, and to permit persons to whom the | ||
9 | // Software is furnished to do so, subject to the following conditions: | ||
10 | // | ||
11 | // The above copyright notice and this permission notice shall be included in | ||
12 | // all copies or substantial portions of the Software. | ||
13 | // | ||
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | // DEALINGS IN THE SOFTWARE. | ||
21 | |||
22 | #ifndef __i18n_h | ||
23 | #define __i18n_h | ||
24 | |||
25 | #ifdef NLS | ||
26 | # include "../nls/blackbox-nls.hh" | ||
27 | #endif // NLS | ||
28 | |||
29 | #ifdef HAVE_LOCALE_H | ||
30 | # include <locale.h> | ||
31 | #endif // HAVE_LOCALE_H | ||
32 | |||
33 | #ifdef HAVE_NL_TYPES_H | ||
34 | // this is needed for linux libc5 systems | ||
35 | extern "C" { | ||
36 | # include <nl_types.h> | ||
37 | } | ||
38 | #endif // HAVE_NL_TYPES_H | ||
39 | |||
40 | |||
41 | class I18n { | ||
42 | private: | ||
43 | char *locale, *catalog_filename; | ||
44 | int mb; | ||
45 | nl_catd catalog_fd; | ||
46 | |||
47 | |||
48 | protected: | ||
49 | I18n(void); | ||
50 | |||
51 | public: | ||
52 | //so old compilators dont complain | ||
53 | ~I18n(void); | ||
54 | |||
55 | static I18n *instance(); | ||
56 | inline const char *getLocale(void) const { return locale; } | ||
57 | inline const char *getCatalogFilename(void) const { return catalog_filename; } | ||
58 | |||
59 | inline const int &multibyte(void) const { return mb; } | ||
60 | |||
61 | inline const nl_catd &getCatalogFd(void) const { return catalog_fd; } | ||
62 | |||
63 | const char *getMessage(int, int, const char * = 0); | ||
64 | void openCatalog(const char *); | ||
65 | }; | ||
66 | |||
67 | |||
68 | //extern I18n *i18n; | ||
69 | extern void NLSInit(const char *); | ||
70 | |||
71 | #endif // __i18n_h | ||