aboutsummaryrefslogtreecommitdiffstats
path: root/agent/divert-scd.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-06-30 19:58:02 +0000
committerWerner Koch <[email protected]>2015-06-30 19:58:45 +0000
commite76d4c05b24211f3981ab69cddb3fccc17d21e0e (patch)
treef62e615bffca562ef096cb8babd9e8c2b70379d5 /agent/divert-scd.c
parentRemove obsolete file g10/comment.c. (diff)
downloadgnupg-e76d4c05b24211f3981ab69cddb3fccc17d21e0e.tar.gz
gnupg-e76d4c05b24211f3981ab69cddb3fccc17d21e0e.zip
agent: Use different translation func for Pinentry strings.
* po/Makevars (XGETTEXT_OPTIONS): Add keyword "L_". * common/i18n.c (i18n_localegettext): New stub. * common/i18n.h: Expand the LunderscoreIMPL macro. * agent/agent.h (L_): New. (LunderscoreIMPL): New. * agent/call-pinentry.c (setup_qualitybar): Add arg ctrl anc change caller. * agent/findkey.c (try_unprotect_cb): Add local var ctrl. * agent/genkey.c (check_passphrase_constraints): Replace xtryasprintf by xtrystrdup to avoid gcc warning. Unfortinately this changes the string. (agent_ask_new_passphrase): Cleanup the use of initial_errtext. -- Static strings in gpg-agent need to be translated according to the locale set by the caller. This is required so that a gpg-agent can be started in one locale and a gpg can be run in another. If we don't do this the static strings (prompt, buttons) are not or in the wrong locale translated while dynamic strings (e.g. key description) uses the locale of gpg. This is only the first part of the change the actual local switching still needs to be implemented. Debian-bug-id: 788983 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'agent/divert-scd.c')
-rw-r--r--agent/divert-scd.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/agent/divert-scd.c b/agent/divert-scd.c
index 0c287b4dd..a2da9e70e 100644
--- a/agent/divert-scd.c
+++ b/agent/divert-scd.c
@@ -89,9 +89,9 @@ ask_for_card (ctrl_t ctrl, const unsigned char *shadow_info, char **r_kid)
"%s:%%0A%%0A"
" \"%.*s\"",
no_card
- ? _("Please insert the card with serial number")
- : _("Please remove the current card and "
- "insert the one with serial number"),
+ ? L_("Please insert the card with serial number")
+ : L_("Please remove the current card and "
+ "insert the one with serial number"),
want_sn_displen, want_sn) < 0)
{
rc = out_of_core ();
@@ -201,19 +201,19 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
for (s=info+1; s < ends; s++)
{
if (*s == 'A')
- prompt = _("Admin PIN");
+ prompt = L_("Admin PIN");
else if (*s == 'P')
{
/* TRANSLATORS: A PUK is the Personal Unblocking Code
used to unblock a PIN. */
- prompt = _("PUK");
+ prompt = L_("PUK");
is_puk = 1;
}
else if (*s == 'N')
newpin = 1;
else if (*s == 'R')
{
- prompt = _("Reset Code");
+ prompt = L_("Reset Code");
resetcode = 1;
}
}
@@ -239,7 +239,7 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
char *desc;
if ( asprintf (&desc,
- _("%s%%0A%%0AUse the reader's pinpad for input."),
+ L_("%s%%0A%%0AUse the reader's pinpad for input."),
info) < 0 )
rc = gpg_error_from_syserror ();
else
@@ -288,18 +288,18 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
pi2->max_tries = 1;
rc = agent_askpin (ctrl,
(resetcode?
- _("Repeat this Reset Code"):
+ L_("Repeat this Reset Code"):
is_puk?
- _("Repeat this PUK"):
- _("Repeat this PIN")),
+ L_("Repeat this PUK"):
+ L_("Repeat this PIN")),
prompt, NULL, pi2, NULL, 0);
if (!rc && strcmp (pi->pin, pi2->pin))
{
again_text = (resetcode?
- N_("Reset Code not correctly repeated; try again"):
+ L_("Reset Code not correctly repeated; try again"):
is_puk?
- N_("PUK not correctly repeated; try again"):
- N_("PIN not correctly repeated; try again"));
+ L_("PUK not correctly repeated; try again"):
+ L_("PIN not correctly repeated; try again"));
xfree (pi2);
xfree (pi);
goto again;
@@ -311,7 +311,7 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
{
char *desc;
if ( asprintf (&desc,
- _("Please enter the PIN%s%s%s to unlock the card"),
+ L_("Please enter the PIN%s%s%s to unlock the card"),
info? " (":"",
info? info:"",
info? ")":"") < 0)