Commit df3c9a76 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Support for pgettext

parent 9a8505c3
...@@ -827,6 +827,12 @@ VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) ); ...@@ -827,6 +827,12 @@ VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) );
*****************************************************************************/ *****************************************************************************/
VLC_EXPORT( char *, vlc_gettext, ( const char *msgid ) LIBVLC_USED ); VLC_EXPORT( char *, vlc_gettext, ( const char *msgid ) LIBVLC_USED );
static inline const char *vlc_pgettext( const char *ctx, const char *id )
{
const char *tr = vlc_gettext( id );
return (tr == ctx) ? id : tr;
}
/***************************************************************************** /*****************************************************************************
* libvlc features * libvlc features
*****************************************************************************/ *****************************************************************************/
......
...@@ -175,7 +175,9 @@ typedef void *locale_t; ...@@ -175,7 +175,9 @@ typedef void *locale_t;
#endif #endif
/* libintl support */ /* libintl support */
#define _(str) vlc_gettext (str) #define _(str) gettext(str)
#define gettext(str) vlc_gettext (str)
#define pgettext(ctx,id) vlc_pgettext(ctx,id)
#if defined (ENABLE_NLS) #if defined (ENABLE_NLS)
# include <libintl.h> # include <libintl.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment