Support VERSION_REVTYPE git builds on cleanup_checkout.sh
[freeciv.git] / utility / fcintl.h
blob038b112ab8af49e9a2d7f70557c9a6af583f1508
1 /**********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
13 #ifndef FC__FCINTL_H
14 #define FC__FCINTL_H
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
20 #include "freeciv_config.h"
22 #ifdef FREECIV_HAVE_LOCALE_H
23 #include <locale.h>
24 #endif
26 #include "shared.h" /* bool */
28 #ifdef FREECIV_ENABLE_NLS
30 /* Include libintl.h only if nls enabled.
31 * It defines some wrapper macros that
32 * we don't want defined when nls is disabled. */
33 #ifdef FREECIV_HAVE_LIBINTL_H
34 #include <libintl.h>
35 #endif
37 /* Core freeciv */
38 #define _(String) gettext(String)
39 #define DG_(domain, String) dgettext(domain, String)
40 #define N_(String) String
41 #define Q_(String) skip_intl_qualifier_prefix(gettext(String))
42 #define PL_(String1, String2, n) ngettext((String1), (String2), (n))
44 /* Ruledit */
45 #define R__(String) dgettext("freeciv-ruledit", String)
46 #define RQ_(String) skip_intl_qualifier_prefix(dgettext("freeciv-ruledit", String))
48 #else /* FREECIV_ENABLE_NLS */
50 /* Core freeciv */
51 #define _(String) (String)
52 #define DG_(domain, String) (String)
53 #define N_(String) String
54 #define Q_(String) skip_intl_qualifier_prefix(String)
55 #define PL_(String1, String2, n) ((n) == 1 ? (String1) : (String2))
56 #define C_(String) capitalized_string(String)
58 /* Ruledit */
59 #define R__(String) (String)
60 #define RQ_(String) skip_intl_qualifier_prefix(String)
62 #undef textdomain
63 #undef bindtextdomain
65 #define textdomain(Domain)
66 #define bindtextdomain(Package, Directory)
68 #endif /* FREECIV_ENABLE_NLS */
70 /* This provides an untranslated version of Q_ that allows the caller to
71 * get access to the original string. This may be needed for comparisons,
72 * for instance. */
73 #define Qn_(String) skip_intl_qualifier_prefix(String)
75 const char *skip_intl_qualifier_prefix(const char *str);
76 char *capitalized_string(const char *str);
77 void free_capitalized(char *str);
78 void capitalization_opt_in(void);
79 bool is_capitalization_enabled(void);
81 const char *get_locale_dir(void);
83 #ifdef __cplusplus
85 #endif /* __cplusplus */
87 #endif /* FC__FCINTL_H */