Index: gi18n.h
===================================================================
--- gi18n.h	(revision 5603)
+++ gi18n.h	(working copy)
@@ -22,14 +22,12 @@
 #include <glib/gstrfuncs.h>
 #include <libintl.h>
 
-#define _(String) gettext (String)
-#define Q_(String) g_strip_context ((String), gettext (String))
-#ifdef gettext_noop
-#define N_(String) gettext_noop (String)
-#else
+#define  _(String) gettext (String)
+#define Q_(String) g_dpgettext (NULL, String, NULL)
 #define N_(String) (String)
-#endif
+#define C_(Context,String) g_dpgettext (NULL, Context "\004" String, String)
 
+
 #endif  /* __G_I18N_H__ */
 
 
Index: gi18n-lib.h
===================================================================
--- gi18n-lib.h	(revision 5603)
+++ gi18n-lib.h	(working copy)
@@ -27,14 +27,16 @@
 #error You must define GETTEXT_PACKAGE before including gi18n-lib.h.
 #endif
 
-#define _(String) dgettext (GETTEXT_PACKAGE, String)
-#define Q_(String) g_strip_context ((String), dgettext (GETTEXT_PACKAGE, String))
-#ifdef gettext_noop
-#define N_(String) gettext_noop (String)
-#else
+#define  _(String) dgettext (GETTEXT_PACKAGE, String)
+#define Q_(String) g_dpgettext (GETTEXT_PACKAGE, String, NULL)
 #define N_(String) (String)
-#endif
+#define C_(Context,String) g_dpngettext (GETTEXT_PACKAGE, Context "\004" String, String)
 
+
+#endif  /* __G_I18N_H__ */
+
+
+
 #endif  /* __G_I18N_LIB_H__ */
 
 
Index: gstrfuncs.h
===================================================================
--- gstrfuncs.h	(revision 5603)
+++ gstrfuncs.h	(working copy)
@@ -243,6 +243,10 @@
 G_CONST_RETURN gchar *g_strip_context  (const gchar *msgid, 
 					const gchar *msgval);
 
+G_CONST_RETURN gchar *g_dpgettext      (const gchar *domain,
+                                        const gchar *msgctxtid,
+                                        const gchar *msgid);
+
 G_END_DECLS
 
 #endif /* __G_STRFUNCS_H__ */
Index: gstrfuncs.c
===================================================================
--- gstrfuncs.c	(revision 5603)
+++ gstrfuncs.c	(working copy)
@@ -42,6 +42,7 @@
 #if !defined (HAVE_STRSIGNAL) || !defined(NO_SYS_SIGLIST_DECL)
 #include <signal.h>
 #endif
+#include <libintl.h>
 
 #include "glib.h"
 #include "gprintf.h"
@@ -2841,5 +2842,85 @@
   return i;
 }
 
+
+/**
+ * g_dpgettext:
+ * @domain: the translation domain to use, or %NULL to use
+ *   the domain set with textdomain()
+ * @msgctxtid: a combined message context and message id
+ * @msgid: the message id, or %NULL
+ *
+ * This function is a variant of dgettext() which supports
+ * a disambiguating message context. GNU gettext uses the
+ * '\004' character to separate the message context and
+ * message id in @msgctxtid. This function also supports
+ * the older convention of using '|' as a separator. 
+ *
+ * Applications should normally not use this function directly,
+ * but use the C_() or Q_() macros for translations with
+ * context.
+ *
+ * Returns: The translated string
+ *
+ * Since: 2.14
+ */
+const gchar *
+g_dpgettext (const gchar *domain, 
+             const gchar *msgctxtid, 
+             const gchar *msgid)
+{
+  const gchar *translation;
+  gchar *sep;
+
+  translation = dgettext (domain, msgctxtid);
+
+  if (translation == msgctxtid)
+    {
+      if (msgid)
+        return msgid;
+
+      sep = strchr (msgctxtid, '|');
+ 
+      if (sep)
+        {
+          /* try with '\004' instead of '|', in case
+           * xgettext -kQ_:1g was used
+           */
+          gsize len = strlen (msgctxtid) + 1;
+          gchar tmp[len];
+          memcpy (tmp, msgctxtid, len);
+          tmp[sep - msgctxtid] = '\004';
+
+          translation = dgettext (domain, tmp);
+   
+          if (translation == tmp)
+            return sep + 1; 
+        }
+    }
+
+  return translation;
+}
+
+
+/**
+ * C_:
+ * @msgctxt: a message context, must be a string literal
+ * @msgid: a message id, must be a string literal
+ *
+ * Uses gettext() to get the translation for @msgid. 
+ * @msgctxt is used as a context. This is mainly useful for
+ * short strings which may need different translations, depending
+ * on the context in which they are used.
+ * <informalexample><programlisting>
+ * label1 = C_("Navigation", "Back");
+ * label2 = C_("Body part", "Back");
+ * </programlisting></informalexample> 
+ *
+ * Returns: the translated message
+ *
+ * Since: 2.14
+ */
+
+
 #define __G_STRFUNCS_C__
 #include "galiasdef.c"
Index: glib.symbols
===================================================================
--- glib.symbols	(revision 5603)
+++ glib.symbols	(working copy)
@@ -1116,6 +1116,7 @@
 #endif
 g_strv_length
 g_strip_context
+g_dpgettext
 #endif
 #endif
 
