[vlc-devel] commit: Support for pgettext ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Apr 15 21:06:40 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 15 22:05:34 2009 +0300| [df3c9a76457b6ad680a08c7ffdbae017d1e37145] | committer: Rémi Denis-Courmont 

Support for pgettext

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=df3c9a76457b6ad680a08c7ffdbae017d1e37145
---

 include/vlc_common.h |    6 ++++++
 include/vlc_fixups.h |    4 +++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 2907ec6..869bfc4 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -827,6 +827,12 @@ VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) );
  *****************************************************************************/
 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
  *****************************************************************************/
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index ecc8fec..983ebd8 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -175,7 +175,9 @@ typedef void *locale_t;
 #endif
 
 /* 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)
 # include <libintl.h>




More information about the vlc-devel mailing list