libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRNi18n.h
Go to the documentation of this file.
1 /* Copyright 2010-2016 CoReNum, INSA Lyon, ENS-Lyon
2  *
3  * This file is part of libcrn.
4  *
5  * libcrn is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * libcrn is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libcrn. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * file: CRNi18n.h
19  * \author Yann LEYDIER
20  */
21 
22 #ifndef CRN_I18N_HEADER
23 #define CRN_I18N_HEADER
24 
25 #include <CRN.h>
26 
27 #if defined(CRN_USING_GLIB_INTL)
28 // libintl through glib
29 # include <glib/gi18n-lib.h>
30 # define CRNtextdomain textdomain
31 # define CRNbindtextdomain bindtextdomain
32 # define CRNbind_textdomain_codeset bind_textdomain_codeset
33 #else
34 # if defined(CRN_USING_LIBINTL)
35 // directly using libintl
36 # include <libintl.h>
37 # define _(String) dgettext(GETTEXT_PACKAGE, String)
38 # define N_(String) (String)
39 # define CRNtextdomain textdomain
40 # define CRNbindtextdomain bindtextdomain
41 # define CRNbind_textdomain_codeset bind_textdomain_codeset
42 # else
43 // no i18n
44 # if !defined(CRN_PF_ANDROID)
45 # ifdef _MSC_VER
46 //# pragma message("--> Not using gtk nor libintl. i18n will not be supported.") // no #warning with MSVC
47 # else
48 //# warning "--> Not using gtk nor libintl. i18n will not be supported."
49 # endif
50 # endif
51 # define _(String) (String)
52 # define N_(String) (String)
53  inline char* CRNtextdomain(const char*) { return NULL; }
54  inline char* CRNbindtextdomain(const char*, const char*) { return NULL; }
55  inline char* CRNbind_textdomain_codeset(const char*, const char*) { return NULL; }
56 # endif
57 #endif
58 
59 #endif
60 
char * CRNbindtextdomain(const char *, const char *)
Definition: CRNi18n.h:54
char * CRNtextdomain(const char *)
Definition: CRNi18n.h:53
char * CRNbind_textdomain_codeset(const char *, const char *)
Definition: CRNi18n.h:55