~choreonoid/choreonoid/debian

« back to all changes in this revision

Viewing changes to src/Util/gettext.h.in

  • Committer: Thomas Moulard
  • Date: 2012-10-23 12:43:24 UTC
  • Revision ID: git-v1:351cf736ad49bc7a9a7b9767dee760a013517a5d
Tags: upstream/1.1.0
ImportedĀ UpstreamĀ versionĀ 1.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  This header should not be included in other header files,
 
3
  but included in the most bottom position of the inclusion part in the implementation (.cpp) files
 
4
  where the message internationalization (texts with _("...") form) is required.
 
5
*/
 
6
 
 
7
 
 
8
#ifdef CNOID_GETTEXT_DOMAIN_NAME
 
9
#undef CNOID_GETTEXT_DOMAIN_NAME
 
10
#endif
 
11
#define CNOID_GETTEXT_DOMAIN_NAME "@target@-@CNOID_VERSION@"
 
12
 
 
13
#ifdef _
 
14
#undef _
 
15
#endif
 
16
 
 
17
#cmakedefine01 CNOID_ENABLE_GETTEXT
 
18
 
 
19
#if CNOID_ENABLE_GETTEXT
 
20
 
 
21
#include "libintl.h"
 
22
#define _(text) dgettext(CNOID_GETTEXT_DOMAIN_NAME, text)
 
23
#define N_(string) string
 
24
 
 
25
#else
 
26
 
 
27
namespace cnoid {
 
28
    inline const char* bindtextdomain(const char* domainname, const char* dirname) {
 
29
        return dirname;
 
30
    }
 
31
    inline const char* dgettext(const char* domainname, const char* msgid){
 
32
        return msgid;
 
33
    }
 
34
}
 
35
 
 
36
#define _(string) string
 
37
#define N_(string) string
 
38
 
 
39
#endif