MichaelChirico / potools

Tools for working with translations in R
https://michaelchirico.github.io/potools/
58 stars 2 forks source link

`check_cracked_messages()` doesn't know about the `call.` argument to stop #227

Closed hadley closed 3 years ago

hadley commented 3 years ago
stop("Can't find article called ", src_path(name), call. = FALSE)
< File:build-articles.R, Line:207 >
Potential replacement:
stop(domain=NA, gettextf("Can't find article called %s%s", src_path(name), FALSE))

Should be:

stop("Can't find article called ", src_path(name), call. = FALSE)
< File:build-articles.R, Line:207 >
Potential replacement:
stop(domain=NA, gettextf("Can't find article called %s", src_path(name)), call. = FALSE)

I'm also surprised that domain is set to NA since according to the docs that turns suppresses translations.

MichaelChirico commented 3 years ago

I'm also surprised that domain is set to NA since according to the docs that turns suppresses translations.

That's because gettextf() is doing the translation. So domain=NA in the outer call says "skip the look-up, because it's already done".

Agree the suggested replacement should be cognizant of named arguments and keep them in the outer call.