From c@@rd|@g@bor @end|ng |rom gm@||@com  Wed Dec  2 19:53:56 2020
From: c@@rd|@g@bor @end|ng |rom gm@||@com (=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=)
Date: Wed, 2 Dec 2020 18:53:56 +0000
Subject: [Rd] translation domain is wrong in stopifnot()?
In-Reply-To: <24519.33776.873538.855659@stat.math.ethz.ch>
References: <CABtg=KmgYOiapjccOVrF-qHSsUYzOtu5RAfiaMrbBidmMmhbwg@mail.gmail.com>
 <24519.33776.873538.855659@stat.math.ethz.ch>
Message-ID: <CABtg=KnszU3hWtAzFNENcgDexzm8sAu_4ArryPk+YqJwdghncw@mail.gmail.com>

Bug report: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17998

Gabor

On Wed, Dec 2, 2020 at 12:09 PM Martin Maechler
<maechler at stat.math.ethz.ch> wrote:
>
> >>>>> G?bor Cs?rdi
> >>>>>     on Tue, 1 Dec 2020 23:48:37 +0000 writes:
>
>     > I don't know if this would be considered a bug in either stopifnot()
>     > or (n)gettext(), or not a bug at all, but sometimes the translation
>     > domain is not set properly for stopifnot() messages, so they won't be
>     > translated. E.g.
>
>     > Sys.setenv(LANGUAGE = "de")
>
>     > # This is good
>     > stopifnot(FALSE)
>     > #> Fehler: FALSE ist nicht TRUE
>
>     > f <- function() stopifnot(FALSE)
>     > # This is not
>     > f()
>     > #> Fehler in f() : FALSE is not TRUE
>
>     > Gabor
>
> or even just directly :
>
>   > (function() stopifnot(1))()
>   Fehler in (function() stopifnot(1))() : 1 is not TRUE
>
>
> I agree there is a bug.
>
> The problem is that the default for the optional 'domain'
> argument does not "work" correctly in the 2nd case.
>
> I've checked that this can be worked around if I explicitly add
>
>   , domain = "R-base"
>
> to the ngettext() call   [ and also the gettext() call above ] .
> Then I do get
>
>   > (function() stopifnot(1))()
>   Fehler in (function() stopifnot(1))() : 1 ist nicht TRUE
>   >
>
> For now I'd claim the bug is in the underlying C code of
> gettext() , ngettext() ...
>
> It would we good to report this in R's bugzilla, please,
> see https://www.r-project.org/bugs.html
>
> Martin
>
>



[Rd] translation domain is wrong in stopifnot()?
=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=