sbuild  1.6.10
sbuild-i18n.h
Go to the documentation of this file.
1 /* Copyright © 2005-2007 Roger Leigh <rleigh@debian.org>
2  *
3  * schroot is free software: you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * schroot is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  *********************************************************************/
18 
24 #ifndef SBUILD_I18N_H
25 #define SBUILD_I18N_H
26 
27 #include <sbuild/sbuild-config.h>
28 
29 #ifdef SBUILD_FEATURE_NLS
30 # include <libintl.h>
31 #endif // SBUILD_FEATURE_NLS
32 
33 // Undefine macros which would interfere with our functions.
34 #ifdef gettext
35 #undef gettext
36 #endif
37 #ifdef _
38 #undef _
39 #endif
40 #ifdef gettext_noop
41 #undef gettext_noop
42 #endif
43 #ifdef N_
44 #undef N_
45 #endif
46 
47 namespace sbuild
48 {
55  inline const char *
56  gettext (const char *message)
57  {
58 #ifdef SBUILD_FEATURE_NLS
59  return dgettext (SBUILD_MESSAGE_CATALOGUE, message);
60 #else
61  return message;
62 #endif // SBUILD_FEATURE_NLS
63  }
64 
72  inline const char *
73  _ (const char *message)
74  {
75  return gettext (message);
76  }
77 
84  inline const char *
85  gettext_noop (const char *message)
86  {
87  return message;
88  }
89 
97  inline const char *
98  N_ (const char *message)
99  {
100  return gettext_noop (message);
101  }
102 
103 }
104 
105 #endif /* SBUILD_I18N_H */
106 
107 /*
108  * Local Variables:
109  * mode:C++
110  * End:
111  */
Debian source builder components.
Definition: sbuild-auth-null.h:24
const char * N_(const char *message)
Get a message with no translation.
Definition: sbuild-i18n.h:98
const char * _(const char *message)
Get a translated message.
Definition: sbuild-i18n.h:73
const char * gettext_noop(const char *message)
Get a message with no translation.
Definition: sbuild-i18n.h:85
const char * gettext(const char *message)
Get a translated message.
Definition: sbuild-i18n.h:56