Fix Matins bible-plan readings stuck on stale "translation pending"
resolveReading() in bible-plan.ts preferred each YAML row's hardcoded
status: { la: missing, en: missing } over computing status from the
actually-resolved text. That field was accurate before the Vulgate/
Douay-Rheims bulk import but was never cleared once real text landed,
so every Matins bible-plan reading kept showing as untranslated
regardless. Strip the stale field from all 368 files so status falls
through to the real compute-from-resolved-text path.
Also alias book abbreviations in scripture/index.ts's lookup: the
bulk-imported store uses Vulgate-numbering codes (sap, jac, joan,
1reg..4reg, 1par/2par, 1esdr/2esdr, ...) matching octave-readings.ts's
existing convention, while bible-plan.ts's TSV import used common
English abbreviations (kgs, sam, chr, john, jas, luke, mark, ...) for
the ~30 books where the two conventions diverge. Alias at the lookup
layer so citations keep their familiar English display form.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Je2mXNHoXmi1DS3xEL67rH
This commit is contained in:
+40
-1
@@ -12,8 +12,47 @@ for (const mod of Object.values(modules)) {
|
||||
chapters.set(`${mod.default.book}-${mod.default.chapter}`, mod.default);
|
||||
}
|
||||
|
||||
/** The bulk-imported store (src/data/scripture/**) keys books by their
|
||||
* Vulgate-numbering abbreviation (matching the convention octave-readings.ts
|
||||
* content already used, e.g. "sap", "ezek", "jac"), but bible-plan.ts's
|
||||
* ~390-row TSV import used common English abbreviations for the books where
|
||||
* the two conventions diverge (Samuel/Kings/Chronicles/Esdras numbering,
|
||||
* John/Luke/Mark/Judges/Jonah/Joshua names). Aliased here, at the lookup
|
||||
* layer, rather than rewriting every bible-plan YAML row, so citations
|
||||
* (bible-plan.ts's citationLabel) keep displaying the familiar English form
|
||||
* while the store lookup still finds the real chapter. */
|
||||
const BOOK_ALIASES: Record<string, string> = {
|
||||
'1sam': '1reg',
|
||||
'2sam': '2reg',
|
||||
'1kgs': '3reg',
|
||||
'2kgs': '4reg',
|
||||
'1chr': '1par',
|
||||
'2chr': '2par',
|
||||
ezra: '1esdr',
|
||||
neh: '2esdr',
|
||||
'1macc': '1mach',
|
||||
'2macc': '2mach',
|
||||
hag: 'agg',
|
||||
hos: 'osee',
|
||||
zech: 'zach',
|
||||
zeph: 'soph',
|
||||
titus: 'tit',
|
||||
jas: 'jac',
|
||||
jdt: 'jdth',
|
||||
josh: 'jos',
|
||||
judg: 'jdc',
|
||||
jonah: 'jon',
|
||||
john: 'joan',
|
||||
'1john': '1joan',
|
||||
'2john': '2joan',
|
||||
'3john': '3joan',
|
||||
luke: 'luc',
|
||||
mark: 'marc',
|
||||
mic: 'mich',
|
||||
};
|
||||
|
||||
export function getScriptureChapter(book: string, chapter: number): ScriptureChapter | undefined {
|
||||
return chapters.get(`${book}-${chapter}`);
|
||||
return chapters.get(`${BOOK_ALIASES[book] ?? book}-${chapter}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user