edelib  2.1.0
Nls.h
1 /*
2  * $Id: Nls.h 3025 2010-03-28 01:14:54Z karijes $
3  *
4  * Locale functions
5  * Copyright (c) 2005-2010 edelib authors
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __EDELIB_NLS_H__
22 #define __EDELIB_NLS_H__
23 
24 #include "edelib-global.h"
25 
26 #ifdef USE_NLS
27 # include <libintl.h>
28 /*
29  * this definition is used when edelib library code is compiled, so we
30  * can get edelib specific translations from edelib mo file
31  */
32 # ifdef USE_EDELIB_GETTEXT_DOMAIN
33 # define _(s) dgettext("edelib", s)
34 # else
35 # define _(s) gettext(s)
36 # endif
37 #else
38 # define textdomain(domain) ((const char*)domain)
39 # define bindtextdomain(domain, dir) ((const char*)dir)
40 # define bind_textdomain_codeset(domain, codeset) ((const char*)codeset)
41 # define _(s) (s)
42 #endif
43 
44 #define N_(s) (s)
45 
46 EDELIB_NS_BEGIN
47 
66 EDELIB_API char* nls_locale_to_c(void);
67 
72 EDELIB_API void nls_locale_from_c(char* old);
73 
94 EDELIB_API void nls_support_init(const char* appname, const char* dir);
95 
96 EDELIB_NS_END
97 #endif
void nls_locale_from_c(char *old)
char * nls_locale_to_c(void)
void nls_support_init(const char *appname, const char *dir)