glib/glib/glibintl.h
changeset 18 47c74d1534e1
child 34 5fae379060a7
equal deleted inserted replaced
0:e4d67989cc36 18:47c74d1534e1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __GLIBINTL_H__
       
    19 #define __GLIBINTL_H__
       
    20 
       
    21 #ifndef SIZEOF_CHAR
       
    22 #error "config.h must be included prior to glibintl.h"
       
    23 #endif
       
    24 IMPORT_C G_CONST_RETURN gchar *glib_gettext (const gchar *str) G_GNUC_FORMAT(1);
       
    25 
       
    26 #ifdef ENABLE_NLS
       
    27 
       
    28 #include <libintl.h>
       
    29 #define _(String) glib_gettext(String)
       
    30 /* Split out this in the code, but keep it in the same domain for now */
       
    31 #define P_(String) glib_gettext(String)
       
    32 
       
    33 #ifdef gettext_noop
       
    34 #define N_(String) gettext_noop(String)
       
    35 #else
       
    36 #define N_(String) (String)
       
    37 #endif
       
    38 #else /* NLS is disabled */
       
    39 #define _(String) (String)
       
    40 #define N_(String) (String)
       
    41 #define P_(String) (String)
       
    42 #define textdomain(String) ((String) ? (String) : "messages")
       
    43 #define gettext(String) (String)
       
    44 #define dgettext(Domain,String) (String)
       
    45 #define dcgettext(Domain,String,Type) (String)
       
    46 #define dngettext(Domain,String1,String2,N) ((N) == 1 ? (String1) : (String2))
       
    47 #define bindtextdomain(Domain,Directory) (Domain) 
       
    48 #define bind_textdomain_codeset(Domain,Codeset)
       
    49 #endif
       
    50 
       
    51 /* not really I18N-related, but also a string marker macro */
       
    52 #define I_(string) g_intern_static_string (string)
       
    53 
       
    54 #endif /* __GLIBINTL_H__ */