From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 3/3] mkfs i18n:
Date: Thu, 22 Sep 2011 10:50:46 +0100 [thread overview]
Message-ID: <1316685046.2709.3.camel@menhir> (raw)
In-Reply-To: <20110920172709.GA6360@andromeda.usersys.redhat.com>
Hi,
On Tue, 2011-09-20 at 14:27 -0300, Carlos Maiolino wrote:
> Hi,
> On Tue, Sep 06, 2011 at 08:10:06PM +0100, Steven Whitehouse wrote:
> > Hi,
> >
> > On Tue, 2011-09-06 at 14:41 -0300, Carlos Maiolino wrote:
> > > Use rpmatch() function to get answer to
> > > yes-or-no questions during mkfs confirmation
> > >
> > > Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> > > ---
> > > gfs2/mkfs/main_mkfs.c | 30 ++++++++++++++++++++++--------
> > > 1 files changed, 22 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
> > > index 4751f19..d68cf98 100644
> > > --- a/gfs2/mkfs/main_mkfs.c
> > > +++ b/gfs2/mkfs/main_mkfs.c
> > > @@ -456,8 +456,11 @@ fail:
> > >
> > > static void are_you_sure(struct gfs2_sbd *sdp)
> > > {
> > > - char input[32];
> > > + char *line = NULL;
> > > + size_t len = 0;
> > > int fd;
> > > + int ret = -1;
> > > + int res = 0;
> > >
> > > fd = open(sdp->device_name, O_RDONLY|O_CLOEXEC);
> > > if (fd < 0)
> > > @@ -465,14 +468,25 @@ static void are_you_sure(struct gfs2_sbd *sdp)
> > > printf( _("This will destroy any data on %s.\n"), sdp->device_name);
> > > check_dev_content(sdp->device_name);
> > > close(fd);
> > > - printf( _("\nAre you sure you want to proceed? [y/n] "));
> > > - if(!fgets(input, 32, stdin))
> > > - die( _("unable to read from stdin\n"));
> > > +
> > > + do{
> > > + printf( _("\nAre you sure you want to proceed? [y/n]"));
> > This means that the translator needs to know that rpmatch is being used
> > and to also know how to translate this accordingly. Why not use
> > nl_langinfo() to put the response strings into this message?
> >
> I was looking how nl_langinfo() works, and all it does to help with yes/no
> questions is to return a regex expression (like [^[SsyY].*) to be used to match
> the user's answer, it does not return a string or char value like yes/no (en_US) or
> sim/nao(pt_BR) we can use to replace the y/n in the question string.
>
> The rpmatch() function takes advantage of nl_langinfo() internaly to match the
> customer's answer according to which l10n the system is set.
>
> This way, even using nl_langinfo(), the translator person will still need to translate
> the y/n to s/n, since is not possible to use nl_langinfo to replace these values.
>
> What we could do, is to create an auxiliar function to check the return of nl_langinfo(),
> and, according with this value, write an specific string (s/n, y/n, etc). But, imho, this
> could lead to an error prone condition during string creation.
>
> What u think?
>
> Cheers,
It is is not possible to use glibc for this, then lets not worry about
it too much. I just wanted to be certain that there was not some
standard way to deal with these kinds of translations before we create
our own solution to the problem,
Steve.
prev parent reply other threads:[~2011-09-22 9:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-06 17:41 [Cluster-devel] [PATCH 3/3] mkfs i18n: Carlos Maiolino
2011-09-06 18:29 ` Bob Peterson
2011-09-06 19:10 ` Steven Whitehouse
2011-09-20 17:27 ` Carlos Maiolino
2011-09-21 0:33 ` Carlos Maiolino
2011-09-22 9:47 ` Steven Whitehouse
2011-09-22 9:50 ` Steven Whitehouse [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1316685046.2709.3.camel@menhir \
--to=swhiteho@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.