rusackas commented on code in PR #39448:
URL: https://github.com/apache/superset/pull/39448#discussion_r3244220979


##########
scripts/translations/build_translation_index.py:
##########


Review Comment:
   Good call — added in de4c929e44.
   
   17 tests under 
`tests/unit_tests/scripts/translations/build_translation_index_test.py` 
covering the two pure helpers (`_is_translated`, `_plural_key`) and the 
`build_index` workflow against a `tmp_path` fixture with three fake languages.
   
   The tests lock in the cross-language index contract that the backfill prompt 
relies on:
   - fuzzy entries surface as `null` (so unreviewed drafts don't feed back into 
the prompt as trusted context, and don't inflate `--min-context`)
   - every msgid has a slot for every non-en language (`null` when missing)
   - plural entries are keyed by the `msgid\x00msgid_plural` composite
   - the `en` source locale and directories without `LC_MESSAGES/messages.po` 
are excluded
   - the `.po` header entry (empty msgid) is skipped
   
   Pairs with the existing `backfill_po_test.py` (already on the PR) which 
covers `parse_response` and `_apply_translation` — together they cover both 
scripts in this PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to