Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The language is not respected when running inline code #1619

Open
olivroy opened this issue May 7, 2024 · 0 comments
Open

The language is not respected when running inline code #1619

olivroy opened this issue May 7, 2024 · 0 comments

Comments

@olivroy
Copy link
Contributor

olivroy commented May 7, 2024

My system language is French, but when I redocument packages, I'd like the language set in DESCRIPTION to be respected.

Given the following reprex

library(roxygen2)
roc_proc_text(rd_roclet(), "
  #' Title
  #'
  #' ```{r}
  #' try(mean(x))
  #' ```
  #' @export
  foo <- function() {}"
)
$foo.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in ./<text>
\name{foo}
\alias{foo}
\title{Title}
\usage{
foo()
}
\description{
\if{html}{\out{<div class="sourceCode r">}}\preformatted{try(mean(x))
#> Error in eval(expr, envir, enclos) : objet 'x' introuvable
}\if{html}{\out{</div>}}
}

As you can see, the error is in French. objet 'x' introuvable

When I redocument rlang, I get some changes in the Rd file, so I have to be careful not to commit them. So I wonder if roxygen2 could set the locale internally so that this doesn't happen

Actually could take inspiration from https://github.com/r-lib/roxygen2/pull/1621/files and add local_language() or local_locale()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant