2006-08-02 23:54:07 -07:00
|
|
|
/*
|
|
|
|
* mooi18n.c
|
|
|
|
*
|
2007-04-07 01:21:52 -07:00
|
|
|
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
2006-08-02 23:54:07 -07:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "mooutils/mooi18n.h"
|
2006-12-10 14:52:08 -08:00
|
|
|
#include "mooutils/mooutils-misc.h"
|
2006-08-02 23:54:07 -07:00
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
|
|
|
|
const char *
|
2006-08-05 00:07:56 -07:00
|
|
|
moo_gettext (const char *string)
|
2006-08-02 23:54:07 -07:00
|
|
|
{
|
2006-08-05 00:07:56 -07:00
|
|
|
#ifdef ENABLE_NLS
|
2006-08-02 23:54:07 -07:00
|
|
|
static gboolean been_here = FALSE;
|
|
|
|
|
|
|
|
g_return_val_if_fail (string != NULL, NULL);
|
|
|
|
|
|
|
|
if (!been_here)
|
|
|
|
{
|
|
|
|
been_here = TRUE;
|
2007-05-08 18:26:03 -07:00
|
|
|
bindtextdomain (GETTEXT_PACKAGE, moo_get_locale_dir ());
|
2006-12-10 14:52:08 -08:00
|
|
|
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
|
2006-08-02 23:54:07 -07:00
|
|
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
2006-12-10 14:52:08 -08:00
|
|
|
#endif
|
2006-08-02 23:54:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return dgettext (GETTEXT_PACKAGE, string);
|
2006-08-05 00:07:56 -07:00
|
|
|
#else /* !ENABLE_NLS */
|
|
|
|
return string;
|
|
|
|
#endif /* !ENABLE_NLS */
|
2006-08-02 23:54:07 -07:00
|
|
|
}
|