Skip to content

Conversation

@jianwei1
Copy link
Contributor

@jianwei1 jianwei1 commented Jan 27, 2026

Summary by CodeRabbit

  • New Features
    • Enhanced Bible content handling during translations: Bible text is preserved, while book names and references are accurately translated and formatted according to target language conventions.
    • Added support for multiple Bible reference formats with language-specific punctuation adaptation.

✏️ Tip: You can customize this high-level summary in your review settings.

@jianwei1 jianwei1 self-assigned this Jan 27, 2026
@linear
Copy link

linear bot commented Jan 27, 2026

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Walkthrough

Adds Bible-specific handling to journeyAiTranslate prompts: do not translate Bible content; use prior journey analysis translation or default to a popular English translation if unavailable. Translate Bible references (book names and separators) to target language. Applies at card-level and batch translation while preserving IDs and existing flow.

Changes

Cohort / File(s) Summary
Bible Content Translation Rules
apis/api-journeys-modern/src/schema/journeyAiTranslate/journeyAiTranslate.ts
Integrated prompt rules to avoid translating Bible passages; reuse prior Bible translation or fall back to a popular English version; translate Bible reference book names and adapt chapter:verse separators; ensure references are correctly formatted in both card-level and batch flows; minor phrasing standardization

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • JesusFilm/core PR 6798: Overlapping changes in journeyAiTranslate.ts for Bible passage handling and block/card translation logic.
  • JesusFilm/core PR 8392: Related updates to journeyAiTranslate translation flows/prompts, integrating customization-fields translation with similar prompt structure.

Suggested reviewers

  • tataihono
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating block translation prompts to handle Bible references, which is the primary focus of the modifications to the journeyAiTranslate.ts file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jianweichong/nes-1238-fix-translation-bug-for-bible-book-names-like-luke

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • NES-1238: GraphQL Error (Code: 502) -
<title>502 Bad Gateway</title>

502 Bad Gateway


cloudflare

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Jan 27, 2026

View your CI Pipeline Execution ↗ for commit d6e1273

Command Status Duration Result
nx affected --target=subgraph-check --base=5cf8... ✅ Succeeded 2s View ↗
nx affected --target=extract-translations --bas... ✅ Succeeded <1s View ↗
nx affected --target=lint --base=5cf8932a86884d... ✅ Succeeded 27s View ↗
nx affected --target=type-check --base=5cf8932a... ✅ Succeeded 21s View ↗
nx run-many --target=codegen --all --parallel=3 ✅ Succeeded 2s View ↗
nx run-many --target=prisma-generate --all --pa... ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-27 20:22:38 UTC

mikeallisonJS
mikeallisonJS previously approved these changes Jan 27, 2026
@stage-branch-merger
Copy link

I see you added the "on stage" label, I'll get this merged to the stage branch!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
`@apis/api-journeys-modern/src/schema/journeyAiTranslate/journeyAiTranslate.ts`:
- Around line 369-374: Update the prompt text in the "IMPORTANT - Bible Content
Handling" prompt block by removing the duplicated word "the" so the sentence
reads "If there is no Bible translation available, use the most popular English
Bible translation available." Locate the prompt string containing the exact
phrase "IMPORTANT - Bible Content Handling" in journeyAiTranslate.ts and edit
that constant or template literal (where the prompt is defined) to correct "use
the the" → "use the".
- Around line 369-385: The cardAnalysisPrompt used in the mutation flow is
missing the Bible content handling rules, causing inconsistent behavior; update
the mutation prompt in journeyAiTranslate.ts by either (a) copying the entire
Bible handling block (the "IMPORTANT - Bible Content Handling" section) into the
cardAnalysisPrompt definition so it enforces: do not translate Bible passages,
reuse previous journey Bible translations or default to a popular English
translation if missing, and translate Bible REFERENCES (book names +
chapter:verse) adapting book names and separators for the target language; or
(b) better, extract that Bible handling text into a shared constant (e.g.,
BIBLE_REFERENCE_PROMPT_SNIPPET) and include that constant in both the
subscription prompt and cardAnalysisPrompt to ensure both flows use identical
rules. Ensure you reference and update the cardAnalysisPrompt symbol in
journeyAiTranslate.ts.

Comment on lines 369 to 385
IMPORTANT - Bible Content Handling:
- If you are in the process of translating and you recognize passages from the
Bible you should not translate that content. Instead, you should rely on a Bible
translation available from the previous journey analysis and use that content directly.
You must never make changes to content from the Bible yourself.
If there is no Bible translation was available, use the the most popular English Bible translation available.
If there is no Bible translation available, use the the most popular English Bible translation available.

- Bible REFERENCES (book names like "Luke", "Mark", "James" followed by chapter:verse
notation like "2:10" or "13:1") MUST be translated to the target language.
Examples: "Luke 2:10" should become "Lucas 2:10" in Spanish, "Lukas 2,10" in German
(note German uses comma instead of colon). Translate the book name and adapt the
chapter:verse separator to match the target language's conventions.

- References may appear in various formats (e.g., "Luke 2:10", "Luke 2:10-12",
"Mark 10:1, 3"). Always translate the book name and preserve the reference structure
while adapting formatting to the target language.
`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Keep Bible-reference rules consistent across translation flows.

Only the subscription path gets the new Bible-reference rules. The mutation path (cardAnalysisPrompt) still lacks them, so behavior diverges based on which API is used. Please mirror the same rules there (or extract a shared prompt snippet).

🛠️ Suggested patch (mutation prompt)
-If there is no Bible translation was available, use the the most popular English Bible translation available. 
+If there is no Bible translation available, use the most popular English Bible translation available.
+
+Bible REFERENCES (book names like "Luke", "Mark", "James" followed by chapter:verse
+notation like "2:10" or "13:1") MUST be translated to the target language.
+Examples: "Luke 2:10" should become "Lucas 2:10" in Spanish, "Lukas 2,10" in German
+(note German uses comma instead of colon). Translate the book name and adapt the
+chapter:verse separator to match the target language's conventions.
+
+References may appear in various formats (e.g., "Luke 2:10", "Luke 2:10-12",
+"Mark 10:1, 3"). Always translate the book name and preserve the reference structure
+while adapting formatting to the target language.
🤖 Prompt for AI Agents
In `@apis/api-journeys-modern/src/schema/journeyAiTranslate/journeyAiTranslate.ts`
around lines 369 - 385, The cardAnalysisPrompt used in the mutation flow is
missing the Bible content handling rules, causing inconsistent behavior; update
the mutation prompt in journeyAiTranslate.ts by either (a) copying the entire
Bible handling block (the "IMPORTANT - Bible Content Handling" section) into the
cardAnalysisPrompt definition so it enforces: do not translate Bible passages,
reuse previous journey Bible translations or default to a popular English
translation if missing, and translate Bible REFERENCES (book names +
chapter:verse) adapting book names and separators for the target language; or
(b) better, extract that Bible handling text into a shared constant (e.g.,
BIBLE_REFERENCE_PROMPT_SNIPPET) and include that constant in both the
subscription prompt and cardAnalysisPrompt to ensure both flows use identical
rules. Ensure you reference and update the cardAnalysisPrompt symbol in
journeyAiTranslate.ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants