fix: keep custom language keys in the resolved translations - #14773
Open
mcanouil wants to merge 2 commits into
Open
fix: keep custom language keys in the resolved translations#14773mcanouil wants to merge 2 commits into
mcanouil wants to merge 2 commits into
Conversation
translationsForLang rebuilt the language table from an allow-list, and formatLanguage ran it after merging the user's language object over the defaults, so a key Quarto does not ship was accepted by the schema, merged, and then discarded before templates saw it. Reading it back through $quarto.language.<key>$ gave an empty string with no warning. Copy non-object values through as well. Locale variations are objects and stay out, so the variation loop below keeps merging them itself. Closes quarto-dev#14772
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. |
mcanouil
marked this pull request as ready for review
August 13, 2026 20:25
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.
Closes #14772.
translationsForLangrebuilt the language table from an allow-list and ran after the user'slanguageobject was merged over the defaults, so a key Quarto does not ship was accepted by the schema, merged, then discarded before templates saw it.translationsForLangnow also copies non-object values it does not recognise; locale variations are objects, so they stay out and the variation loop below keeps merging them itself.callout-,crossref-orenvironment-now also reach Lua filter params, andsearch-keys reach website search options, because both consumers select by prefix over the whole table._language.ymlwithout a matching entry inkLanguageDefaultsKeysis no longer dropped as a built-in default.kLanguageDefaultsKeysfrom_language.ymlat build time, so the YAML file, the constants array and the schema cannot drift.The test renders one Typst document through a
typst-show.typpartial and reads back four keys: the custom key, an override of a built-in key, an untouched built-in key, and a key supplied through a locale variation.