Skip to content

Fill in missing translation keys and add a parity test - #3008

Open
sridhar-3009 wants to merge 2 commits into
Chainlit:mainfrom
sridhar-3009:fix/translation-parity-2993
Open

Fill in missing translation keys and add a parity test#3008
sridhar-3009 wants to merge 2 commits into
Chainlit:mainfrom
sridhar-3009:fix/translation-parity-2993

Conversation

@sridhar-3009

@sridhar-3009 sridhar-3009 commented Aug 2, 2026

Copy link
Copy Markdown

Closes #2993.

Six keys present in en-US.json were missing from other locale files under backend/chainlit/translations/:

Locale Missing key
ar-SA chat.favorites.remove
da-DK chat.favorites.remove
de-DE components.DatePickerInput
it components.DatePickerInput
ko components.DatePickerInput
ja chat.fileUpload.browse

Filled 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 placeholders
  • ja: "Browse Files"

The more important part is why this keeps happening: chainlit lint-translations only checks the consuming app's .chainlit/translations/ directory (per lint_translations() in config.py), never the package's own backend/chainlit/translations/, and no CI workflow touches translations at all. So a PR that adds a key to en-US.json and forgets the other files goes green, which is exactly what happened three times here (#2654, #2792, and one predating both).

Added TestTranslationFileParity to backend/tests/test_translations.py, which loads the real backend/chainlit/translations/ directory (via TRANSLATIONS_DIR from chainlit.config) and asserts every locale file has every key en-US.json has, parametrized per file so a failure names the exact locale. en-US.json compared 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, and scripts/type_check.py clean.


Summary by cubic

Filled missing translation keys across six locales and strengthened the parity test against en-US.json to also catch structure mismatches. This keeps all shipped locales complete and consistent.

  • Bug Fixes
    • Filled keys:
      • ar-SA, da-DK: chat.favorites.remove
      • de-DE, it, ko: components.DatePickerInput.placeholder.{single,range}
      • ja: chat.fileUpload.browse
    • Added TestTranslationFileParity in backend/tests/test_translations.py that validates every locale includes all keys and correct shapes from en-US.json (extra keys allowed).

Written for commit 0c59b70. Summary will update on new commits.

Review in cubic

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. translation Translation or localisation of strings. unit-tests Has unit tests. labels Aug 2, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread backend/tests/test_translations.py Outdated
@sridhar-3009

Copy link
Copy Markdown
Author

Good catch — fixed. The test now fails on any non-"Extra" divergence (missing keys and structure mismatches alike), not just missing keys. Pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files. translation Translation or localisation of strings. unit-tests Has unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i18n: 6 translation keys missing across 6 locales, and nothing enforces parity

1 participant