edelib  2.0.0
edelib/Nls.h
00001 /*
00002  * $Id: Nls.h 3025 2010-03-28 01:14:54Z karijes $
00003  *
00004  * Locale functions
00005  * Copyright (c) 2005-2010 edelib authors
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with this library. If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 #ifndef __EDELIB_NLS_H__
00022 #define __EDELIB_NLS_H__
00023 
00024 #include "edelib-global.h"
00025 
00026 #ifdef USE_NLS
00027 # include <libintl.h>
00028 /* 
00029  * this definition is used when edelib library code is compiled, so we
00030  * can get edelib specific translations from edelib mo file
00031  */
00032 # ifdef USE_EDELIB_GETTEXT_DOMAIN
00033 #  define _(s) dgettext("edelib", s)
00034 # else
00035 #  define _(s) gettext(s)
00036 # endif
00037 #else
00038 # define textdomain(domain) ((const char*)domain)
00039 # define bindtextdomain(domain, dir) ((const char*)dir)
00040 # define bind_textdomain_codeset(domain, codeset) ((const char*)codeset)
00041 # define _(s)  (s)
00042 #endif
00043 
00044 #define N_(s) (s)
00045 
00046 EDELIB_NS_BEGIN
00047 
00066 EDELIB_API char* nls_locale_to_c(void);
00067 
00072 EDELIB_API void nls_locale_from_c(char* old);
00073 
00094 EDELIB_API void nls_support_init(const char* appname, const char* dir);
00095 
00096 EDELIB_NS_END
00097 #endif