Map lg=ah/sh to base locale a/s for the readings-svc /learning call - #21
Merged
Conversation
readings-svc 400s on lg=sh/lg=ah ("Locale 'sh' not found") because those
are hebcal-web's own "append the Hebrew name too" spellings, not real
@hebcal/locales names -- their base locales are "a" and "s", and the
appended Hebrew is drawn here in the renderer, not by the sidecar.
learningLocale maps ah->a and sh->s at the readings-client boundary and
passes every other lg through unchanged.
Co-Authored-By: Claude Opus 4.8 <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.
Problem
A PDF download with a daily-learning series and
lg=sh(orlg=ah) fails when the fallback fetches from readings-svc:sh/ahare hebcal-web's own "append the Hebrew name too" spellings, not real@hebcal/localesnames. Their base locales aresanda, and the appended Hebrew is drawn here in the renderer (Params.AppendHebrew), not by the sidecar — so the sidecar just needs the base locale.Fix
learningLocaleininternal/repository/readings/learning.gomapsah→aandsh→sat the readings-client boundary — the only code that talks to readings-svc — and passes every otherlgthrough unchanged.I also audited every other path into the locale packages: all in-process rendering (
model/event.go,render.go,/shabbat) routes throughmodel.AliasLocalefirst, which collapsessh→en/ah→ashkenazibefore anylocales.LookupTranslation. The/learningsidecar was the only leak, because it needs the short base codes rather than the full locale names.Test
TestLearningMapsTransliterationLocalesassertsah→a,sh→s, and thathe/""pass through untouched.🤖 Generated with Claude Code