aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--common/i18n.c12
-rw-r--r--common/i18n.h6
2 files changed, 18 insertions, 0 deletions
diff --git a/common/i18n.c b/common/i18n.c
index 202d84035..e6d3f5e47 100644
--- a/common/i18n.c
+++ b/common/i18n.c
@@ -113,3 +113,15 @@ i18n_utf8 (const char *string)
i18n_switchback (saved);
return result;
}
+
+
+/* A variant of gettext which allows to specify the local to use for
+ translating the message. The function assumes that utf-8 is used
+ for the encoding. FIXME: The locale back and forth switching is
+ likely very expensive, thus we should consider to implement our own
+ cache here. */
+const char *
+i18n_localegettext (const char *lc_messages, const char *string)
+{
+ return _(string);
+}
diff --git a/common/i18n.h b/common/i18n.h
index 3b02a6bbd..8507b8f27 100644
--- a/common/i18n.h
+++ b/common/i18n.h
@@ -42,6 +42,12 @@ void i18n_init (void);
char *i18n_switchto_utf8 (void);
void i18n_switchback (char *saved_codeset);
const char *i18n_utf8 (const char *string);
+const char *i18n_localegettext (const char *lc_messages, const char *string);
+
+/* If a module wants a local L_() fucntion we define it here. */
+#ifdef LunderscoreIMPL
+LunderscoreIMPL
+#endif
#endif /*GNUPG_COMMON_I18N_H*/