Skip to content

PhET: fix ht channel_id and document chef behavior#28

Draft
nucleogenesis wants to merge 1 commit intolearningequality:mainfrom
nucleogenesis:phet/fix-ht-channel-id
Draft

PhET: fix ht channel_id and document chef behavior#28
nucleogenesis wants to merge 1 commit intolearningequality:mainfrom
nucleogenesis:phet/fix-ht-channel-id

Conversation

@nucleogenesis
Copy link
Copy Markdown
Contributor

Summary

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 phet-html5-simulations-ht. The override was dropped during the multi-locale refactor; restoring it returns the deterministic (source_domain, source_id) → channel_id pairing to the legacy value.

Also adds two missing Haitian category labels (Math and Statistics, Earth and Space), drops the now-redundant hardcoded ht channel-title fallback in _localized_channel_title (the CSV provides the title), and adds inline documentation throughout chef.py covering the locale-fallback chain, source_id stability rules, the PhET-API → Kolibri metadata mapping, and the offline-mode HTML patches.

Verification status: the ht source_id pair was confirmed against the original publishing commit (df1749727 in the old sushi-chef-phet repo). Re-running the chef for ht and 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-phet repo on the i18n--running-all-languages branch (commit a59864fa7, "Fix ht channel_id and document chef behavior"). It is being migrated here as part of consolidating per-chef repos into kolibri-library.

Reviewer guidance

How to verify:

  1. Run the chef with --lang=ht against staging Studio. Confirm it lands on the existing Haitian Creole channel, not a new phet-html5-simulations-ht channel.
  2. Sanity-check a known-good locale (e.g. --lang=ar) still publishes to the existing Arabic channel — only the ht branch changed but worth confirming nothing else regressed.
  3. In the resulting Haitian channel, check that Math and Statistics and Earth and Space render with their Haitian translations rather than English.

Risky areas:

  • phet/chef.py:run_with_locale — the restored elif locale == "ht" override. Same shape as the existing uk / pt / es overrides; 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 the ht-only hardcoded title. If the CSV is missing a ht row, the chef now falls through to f"{BASE_TITLE} ({getlang('ht').native_name})" — still reasonable but visibly different from the prior hardcoded value.

Open follow-ups (not addressed here):

  • The orphaned phet-html5-simulations-ht channel created by the pre-fix run still exists on Studio; needs a delete/archive decision.
  • The if/elif chain in run_with_locale could be replaced with a LOCALE_OVERRIDES dict (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.py and to assemble this PR description from the handoff doc. I read the diff line-by-line, verified the ht source_id against the publishing commit's tree, and confirmed the comment additions don't change runtime behavior.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant