PhET: fix ht channel_id and document chef behavior#28
Draft
nucleogenesis wants to merge 1 commit intolearningequality:mainfrom
Draft
PhET: fix ht channel_id and document chef behavior#28nucleogenesis wants to merge 1 commit intolearningequality:mainfrom
nucleogenesis wants to merge 1 commit intolearningequality:mainfrom
Conversation
Restore the legacy `ht` source_id override (`channel_PhET_Interactive_Simulations_TEST-ht`) so the chef updates the existing Haitian Creole channel on Studio instead of creating a new one under the default-derived id `phet-html5-simulations-ht`. Add two missing Haitian category labels and drop the now-redundant hardcoded `ht` channel-title fallback in `_localized_channel_title`. Annotate the chef with inline comments covering locale handling, source_id stability, the PhET-API/Kolibri metadata mapping, and the offline-mode HTML patches. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Restore the legacy
htsource_id override (channel_PhET_Interactive_Simulations_TEST-ht) so the chef updates the existing Haitian Creole channel on Studio instead of creating a new one underphet-html5-simulations-ht. The override was dropped during the multi-locale refactor; restoring it returns the deterministic(source_domain, source_id) → channel_idpairing to the legacy value.Also adds two missing Haitian category labels (
Math and Statistics,Earth and Space), drops the now-redundant hardcodedhtchannel-title fallback in_localized_channel_title(the CSV provides the title), and adds inline documentation throughoutchef.pycovering the locale-fallback chain, source_id stability rules, the PhET-API → Kolibri metadata mapping, and the offline-mode HTML patches.Verification status: the
htsource_id pair was confirmed against the original publishing commit (df1749727in the oldsushi-chef-phetrepo). Re-running the chef forhtand visually verifying the Haitian translations have not been done post-fix and need a fresh chef run.References
This work was originally done in the deprovisioned
learningequality/sushi-chef-phetrepo on thei18n--running-all-languagesbranch (commita59864fa7, "Fix ht channel_id and document chef behavior"). It is being migrated here as part of consolidating per-chef repos intokolibri-library.Reviewer guidance
How to verify:
--lang=htagainst staging Studio. Confirm it lands on the existing Haitian Creole channel, not a newphet-html5-simulations-htchannel.--lang=ar) still publishes to the existing Arabic channel — only thehtbranch changed but worth confirming nothing else regressed.Math and StatisticsandEarth and Spacerender with their Haitian translations rather than English.Risky areas:
phet/chef.py:run_with_locale— the restoredelif locale == "ht"override. Same shape as the existinguk/pt/esoverrides; low risk in pattern, but the consequence of getting it wrong is publishing to the wrong Studio channel.phet/chef.py:_localized_channel_title— removed theht-only hardcoded title. If the CSV is missing ahtrow, the chef now falls through tof"{BASE_TITLE} ({getlang('ht').native_name})"— still reasonable but visibly different from the prior hardcoded value.Open follow-ups (not addressed here):
phet-html5-simulations-htchannel created by the pre-fix run still exists on Studio; needs a delete/archive decision.if/elifchain inrun_with_localecould be replaced with aLOCALE_OVERRIDESdict (the older code already had this shape — would have made the original regression impossible to introduce silently).AI usage
I used Claude Code (Opus 4.7) to author the inline documentation throughout
chef.pyand to assemble this PR description from the handoff doc. I read the diff line-by-line, verified thehtsource_id against the publishing commit's tree, and confirmed the comment additions don't change runtime behavior.