Fill in missing translation keys and add a parity test - #3008
Open
sridhar-3009 wants to merge 2 commits into
Open
Fill in missing translation keys and add a parity test#3008sridhar-3009 wants to merge 2 commits into
sridhar-3009 wants to merge 2 commits into
Conversation
sridhar-3009
requested review from
asvishnyakov,
hayescode and
sandangel
as code owners
August 2, 2026 16:48
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Author
|
Good catch — fixed. The test now fails on any non-"Extra" divergence (missing keys and structure mismatches alike), not just missing keys. Pushed. |
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 #2993.
Six keys present in
en-US.jsonwere missing from other locale files underbackend/chainlit/translations/:ar-SAchat.favorites.removeda-DKchat.favorites.removede-DEcomponents.DatePickerInputitcomponents.DatePickerInputkocomponents.DatePickerInputjachat.fileUpload.browseFilled in all six (translations below, happy to have a native speaker double check ar-SA/da-DK/de-DE/it/ko/ja):
ar-SA/da-DK: "Remove favorite"de-DE/it/ko: the DatePickerInput single/range placeholdersja: "Browse Files"The more important part is why this keeps happening:
chainlit lint-translationsonly checks the consuming app's.chainlit/translations/directory (perlint_translations()inconfig.py), never the package's ownbackend/chainlit/translations/, and no CI workflow touches translations at all. So a PR that adds a key toen-US.jsonand forgets the other files goes green, which is exactly what happened three times here (#2654, #2792, and one predating both).Added
TestTranslationFileParitytobackend/tests/test_translations.py, which loads the realbackend/chainlit/translations/directory (viaTRANSLATIONS_DIRfromchainlit.config) and asserts every locale file has every keyen-US.jsonhas, parametrized per file so a failure names the exact locale.en-US.jsoncompared against itself is included and passes trivially, as expected.All 57 tests in the file pass, including the 23 new parametrized cases. Ran
scripts/lint.py,scripts/format.py --check, andscripts/type_check.pyclean.Summary by cubic
Filled missing translation keys across six locales and strengthened the parity test against
en-US.jsonto also catch structure mismatches. This keeps all shipped locales complete and consistent.ar-SA,da-DK:chat.favorites.removede-DE,it,ko:components.DatePickerInput.placeholder.{single,range}ja:chat.fileUpload.browseTestTranslationFileParityinbackend/tests/test_translations.pythat validates every locale includes all keys and correct shapes fromen-US.json(extra keys allowed).Written for commit 0c59b70. Summary will update on new commits.