### Bug description

Proof environment title customization is not working in PDF output when using both `language` and `lang` keywords. It doesn't matter what is the base language or document class.

Reproduce:
index.qmd
```
# Start

::: {#thm-thm}
Foo
:::
::: {.proof}
This block should be titled "Test", but instead is titled "Proof".
:::
```
_quarto.yml
```
project:
  type: book

book:
  title: "Test"
  author: "Jane Doe"
  chapters:
    - index.qmd

lang: en
language:
  en:
    environment-proof-title: "Test"

format:
  html:
    theme: cosmo
  pdf:
    documentclass: report

editor: visual
```

### Possible solution

The relevant generated latex code is: `\renewcommand*{\proofname}{Test}`

But that is not having any effect. Currently, the title name is obtained from the language line
`\babelprovide[main,import]{english}`.

Instead, generated latex code should be: `\AtBeginDocument{\renewcommand*{\proofname}{Test}}`

More info:

- Quarto 1.2.280
- R studio 2022.12.0 Build 353
- Windows 11 Pro 22H2

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
dragonstyle
2023-01-02T03:59:47Z
fulem
bug
closed
Proof environment title customization not working in PDF output
https://github.com/quarto-dev/quarto-cli/issues/3820