Skip to content

Conversation

@olivroy
Copy link
Collaborator

@olivroy olivroy commented Sep 27, 2024

Summary

The idea is to avoid stuff like this

---
title: "un document en français"
lang: fr
---

```{r}
options(gt.locale = "fr-CA")
```

```{r}
gt(exibble) |> fmt_number()
```

```{r}
gt(exibble)
```


.
Of course, if you provide locale explicitly anywhere in the calls, it would have precedence on the global option. Please let me know what you think. I see it as a useful way to specify locale globally in a Quarto document / project.

I hoped we could be smarter by detecting lang in Quarto, but it isn't possible. Let me know if you have an alternative idea! I know you are not a fan of global options

quarto-dev/quarto-cli#10886

Related GitHub Issues and PRs

Checklist

@olivroy
Copy link
Collaborator Author

olivroy commented Sep 27, 2024

@rich-iannone
Copy link
Member

It actually seems like a sensible thing in this case! (So thanks for submitting this PR, will review soon.)

Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rich-iannone rich-iannone merged commit 78f8afb into rstudio:master Sep 27, 2024
@rich-iannone
Copy link
Member

@olivroy now merged! Do you have an SO account to provide an update to that question? I don't think I do :/

@olivroy
Copy link
Collaborator Author

olivroy commented Sep 28, 2024

Yes! will do! thanks for merging

@olivroy olivroy deleted the gt-locale branch September 30, 2024 18:27
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

Successfully merging this pull request may close these issues.

2 participants