2006-08-03 00:39:06 -05:00
|
|
|
/*
|
|
|
|
* mooi18n.h
|
|
|
|
*
|
2010-12-21 20:15:45 -08:00
|
|
|
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
|
2006-08-03 00:39:06 -05:00
|
|
|
*
|
2008-09-05 17:20:50 -05:00
|
|
|
* This file is part of medit. medit is free software; you can
|
|
|
|
* redistribute it and/or modify it under the terms of the
|
|
|
|
* GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2.1 of the License,
|
|
|
|
* or (at your option) any later version.
|
2006-08-03 00:39:06 -05:00
|
|
|
*
|
2008-09-05 17:20:50 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with medit. If not, see <http://www.gnu.org/licenses/>.
|
2006-08-03 00:39:06 -05:00
|
|
|
*/
|
|
|
|
|
2007-04-12 10:31:28 -05:00
|
|
|
#ifndef MOO_I18N_H
|
|
|
|
#define MOO_I18N_H
|
2006-08-03 00:39:06 -05:00
|
|
|
|
|
|
|
#include <config.h>
|
2006-08-03 01:54:07 -05:00
|
|
|
#include <glib/gstrfuncs.h>
|
|
|
|
|
|
|
|
#ifdef ENABLE_NLS
|
|
|
|
|
2007-10-08 09:09:39 -05:00
|
|
|
#include <libintl.h>
|
2008-09-09 22:40:29 -05:00
|
|
|
#include <string.h>
|
2007-10-08 09:09:39 -05:00
|
|
|
|
2006-08-05 02:07:56 -05:00
|
|
|
#define _(String) moo_gettext (String)
|
|
|
|
#define Q_(String) g_strip_context ((String), moo_gettext (String))
|
2006-08-03 01:54:07 -05:00
|
|
|
#define N_(String) (String)
|
|
|
|
#define D_(String,Domain) dgettext (Domain, String)
|
2006-08-03 02:29:39 -05:00
|
|
|
#define QD_(String,Domain) g_strip_context ((String), D_ (String, Domain))
|
2008-09-09 22:40:29 -05:00
|
|
|
#define C_(Context,String) moo_pgettext (Context "\004" String, strlen (Context) + 1)
|
|
|
|
#define NC_(Context,String) (String)
|
|
|
|
#define DC_(Context,String,Domain) moo_dpgettext (Domain, Context "\004" String, strlen (Context) + 1)
|
2006-08-03 01:54:07 -05:00
|
|
|
|
|
|
|
#else /* !ENABLE_NLS */
|
|
|
|
|
2006-11-17 23:10:56 -06:00
|
|
|
#undef textdomain
|
|
|
|
#undef gettext
|
|
|
|
#undef dgettext
|
|
|
|
#undef dcgettext
|
2007-02-27 22:55:05 -06:00
|
|
|
#undef ngettext
|
2006-11-17 23:10:56 -06:00
|
|
|
#undef bindtextdomain
|
|
|
|
#undef bind_textdomain_codeset
|
2008-09-09 22:40:29 -05:00
|
|
|
|
2006-08-03 01:54:07 -05:00
|
|
|
#define _(String) (String)
|
|
|
|
#define N_(String) (String)
|
2006-08-03 02:29:39 -05:00
|
|
|
#define Q_(String) g_strip_context ((String), (String))
|
2006-08-03 01:54:07 -05:00
|
|
|
#define D_(String,Domain) (String)
|
2006-08-03 02:29:39 -05:00
|
|
|
#define QD_(String,Domain) g_strip_context ((String), (String))
|
2008-09-09 22:40:29 -05:00
|
|
|
|
|
|
|
#define C_(Context,String) (String)
|
|
|
|
#define NC_(Context,String) (String)
|
|
|
|
#define DC_(Context,String,Domain) (String)
|
|
|
|
|
2006-08-03 01:54:07 -05:00
|
|
|
#define textdomain(String) (String)
|
|
|
|
#define gettext(String) (String)
|
|
|
|
#define dgettext(Domain,String) (String)
|
|
|
|
#define dcgettext(Domain,String,Type) (String)
|
2007-03-06 18:57:19 -06:00
|
|
|
#define ngettext(str,str_pl,n) ((n) > 1 ? (str_pl) : (str))
|
|
|
|
#define dngettext(dom,str,str_pl,n) ((n) > 1 ? (str_pl) : (str))
|
2006-08-03 01:54:07 -05:00
|
|
|
#define bindtextdomain(Domain,Directory) (Domain)
|
|
|
|
#define bind_textdomain_codeset(Domain,Codeset) (Codeset)
|
|
|
|
|
|
|
|
#endif /* !ENABLE_NLS */
|
|
|
|
|
|
|
|
|
2007-10-08 09:09:39 -05:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-12-10 03:10:22 -08:00
|
|
|
#define moo_dgettext(d,s) D_(d,s)
|
|
|
|
|
2008-02-20 18:43:53 -06:00
|
|
|
const char *moo_gettext (const char *string) G_GNUC_FORMAT (1);
|
2008-09-09 22:40:29 -05:00
|
|
|
const char *moo_pgettext (const char *msgctxtid, gsize msgidoffset) G_GNUC_FORMAT (1);
|
|
|
|
const char *moo_pgettext2 (const char *context, const char *msgctxtid) G_GNUC_FORMAT (2);
|
|
|
|
const char *moo_dpgettext (const char *domain, const char *msgctxtid, gsize msgidoffset) G_GNUC_FORMAT (2);
|
2008-02-20 18:43:53 -06:00
|
|
|
const char *_moo_gsv_gettext (const char *string) G_GNUC_FORMAT (1);
|
|
|
|
char *_moo_gsv_dgettext (const char *domain, const char *string) G_GNUC_FORMAT (2);
|
2007-03-06 16:04:49 -06:00
|
|
|
|
2006-08-03 01:54:07 -05:00
|
|
|
G_END_DECLS
|
2006-08-03 00:39:06 -05:00
|
|
|
|
2007-04-12 10:31:28 -05:00
|
|
|
#endif /* MOO_I18N_H */
|