----- Original Message -----
From: "Sumit Bose" <sbose(a)redhat.com>
To: sssd-devel(a)lists.fedorahosted.org
Sent: Wednesday, February 11, 2015 5:50:50 PM
Subject: Re: [SSSD] [PATCH] PAM: do not reject abruptly
On Wed, Feb 11, 2015 at 04:56:48PM +0100, Pavel Reichl wrote:
> Hello,
>
> please see attached patch. I'm not sure whether using pam_strerror() is the
> right thing to do. It might be better to use our own string?
> I'm also not sure about using _(STRING) macro on the output of
> pam_strerror().
The _() macro will not work here. You can use it only to enclose literal
strings. The strings will then be extracted into the *.pot file and
translators can pick them for translation. In the pam_strerror() case
libpam has to take care of the translations.
Note that it is wise to separate localised messages from different sources in some way,
e.g. use '[' and ']' if you embed a text from one l10n catalog into the
text of another l10n catalog - otherwise you might end-up with some kind of text spaghetti
which the user can't understand anymore.
Simple example (ksh builtin cat(1) catalog and |strerror()| l10n catalog are used in one
line (this is getting problematic when both sides have catalogs for the LC_MESSAGES
value)):
-- snip --
$ ksh -c 'builtin cat ; cat /nosuchfile ; true'
cat: /nosuchfile: cannot open [No such file or directory]
$ ksh -c 'builtin cat ; LC_ALL=ja_JP.UTF-8 cat /nosuchfile ; true'
cat: /nosuchfile: cannot open [そのようなファイルやディレクトリはありません]
-- snip --
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) rmainz(a)redhat.com
\__\/\/__/ IPA/Kerberos5 team
/O /==\ O\
(;O/ \/ \O;)