Repository navigation
Conversation
A per-language file such as `_language-fr.yml` is stored as a variation object that applies on top of the plain keys. When a later layer (the document, or the inline `language:` of `_quarto.yml`) set the same key as a plain key, the earlier variation still won once `lang` matched. A plain key from a later layer now also removes that key from the variations of the earlier layers. A variation still wins over the plain keys of its own layer. Fixes quarto-dev#15349
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Profiles, `metadata-files` includes and project type extensions merge through `mergeProjectMetadata`, so a plain `language` key there could still lose to an earlier per-language variation.
`mergeLanguages` now rewrites only plain-object locale blocks, and skips the pass when the later layer sets no plain key, so an array value under `language:` stays an array. The merge rules and localisation notes now describe the cross-layer `language` merge.
Document front matter, `metadata-files` and `--metadata` merge through `mergeQuartoConfigs`, so a plain `language` key from a metadata file could still lose to a locale block in the front matter. The merging architecture notes now describe the `language` rule.
Point the localisation notes at the moved functions, and say in the changelog that inline locale blocks are covered too.
mcanouil
marked this pull request as ready for review
November 12, 2026 13:23
…ion-override-15349 # Conflicts: # news/changelog-1.12.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15349.
Description
A per-language file such as
_language-fr.ymlis read into afrblock next to the plain keys of itslanguagemap, andtranslationsForLangapplies that block last.So a plain key set by a later layer lost to an earlier
frblock as soon aslang: frwas set.This hit extensions against the document, a project's
language:file against a page, the project's own_language-fr.ymlagainst its inline keys, and the front matter againstmetadata-files.The new
mergeLanguagesinsrc/core/language.tsfixes the merge itself, so it doesn't depend onlang.A plain key from a later layer also removes that key from the locale blocks of the earlier layers.
Within one layer, a
fr:value still wins over that layer's plain key.mergeFormatMetadata,mergeProjectMetadataandmergeQuartoConfigsuse it forlanguage, and so does the merge of_language.ymlwith the inline project keys.Four smoke tests under
tests/docs/smoke-all/2026/11/12/cover these cases and fail without the fix.Unit tests in
tests/unit/core/language-merge.test.tspin down the merge rules.The
ipynb-filtersre-merge inrender-contexts.tsstill uses plainmergeConfigs.I left it alone because there is no fixture to test it with.
Checklist
I have (if applicable):