Add support for Odia language subtitles#1
Conversation
WalkthroughThis PR adds Odia language support to the subtitle generation system. The README is updated to document Odia as a newly supported Indian language using AI transcription/translation. A new configuration file provides the prompt template that instructs the system to generate Odia-script SRT subtitles by translating from English, Hindi, or Bengali audio sources. ChangesOdia Language Support
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/prompts/ori.yaml`:
- Line 5: The ori prompt currently restricts source languages to
English/Hindi/Bengali so there is no Odia→Odia transcription path; either
broaden the existing 'ori' prompt to allow Odia as a source (remove the "First
understand the audio in English/Hindi/Bengali" restriction) or add a new
direct-transcription prompt named 'ori_direct' and update the configuration that
assigns method: "translate" for 'ori' to reference 'ori_direct' for
transcription cases; also update ConfigManager.get_prompt to handle 'ori' like
the existing 'hin' special-case so the new prompt is selected, and revise the
README to accurately describe whether 'ori' supports Odia direct transcription
or only EN/HI/BN→Odia translation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b46fbbdd-b74e-4713-bf42-a2db808e9cde
📒 Files selected for processing (2)
README.mdconfig/prompts/ori.yaml
| Generate Odia subtitles by translating from the audio content. | ||
|
|
||
| INSTRUCTIONS: | ||
| - First understand the audio in English/Hindi/Bengali |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Compare prompt patterns across language configurations to verify consistency
# Check if other Indian language prompts also limit source languages or support transcription
fd -e yaml . config/prompts/ --exec cat {} \; --exec echo "--- File: {} ---"Repository: hoichoi-opensource/video-subtitle-generator
Length of output: 20104
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Look for the README/docs reference to "transcription/translation"
rg -n --hidden --glob '!**/node_modules/**' -S "transcription/translation|transcription|translation" README.md . || true
# Also list any docs mentioning language support/source languages
rg -n --hidden --glob '!**/node_modules/**' -S "English/Hindi/Bengali|source language|source languages" . || trueRepository: hoichoi-opensource/video-subtitle-generator
Length of output: 30696
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find how prompts are chosen and whether "translation method" implies transcription of arbitrary source languages
rg -n "ConfigManager|get_prompt|prompts/|translation method|simple_transcription|fallback_handler|language_selector|source.*auto" src config || true
# Show the core selection logic
echo "----- src/language_selector.py (relevant section) -----"
sed -n '1,220p' src/language_selector.py
echo "----- src/fallback_handler.py (relevant section) -----"
sed -n '1,220p' src/fallback_handler.py
echo "----- src/ai_generator.py (relevant selection/flow) -----"
# Pull only the likely region around method attempts
rg -n "Trying translation method|Translation method:|simple_transcription|Using translation method result|method" -n src/ai_generator.py
sed -n '300,520p' src/ai_generator.py
# Inspect how precision validator/translation quality uses "source language" vs "original text"
echo "----- src/precision_validator.py (source/language handling around translation quality) -----"
sed -n '500,700p' src/precision_validator.pyRepository: hoichoi-opensource/video-subtitle-generator
Length of output: 37690
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# List prompt yaml files
echo "=== config/prompts/*.yaml ==="
fd -e yaml config/prompts --exec sh -c 'echo "{}"' \; | sort
echo "=== Prompt files related to ori ==="
fd -e yaml config/prompts --exec sh -c '
p="{}"
case "$p" in
*ori*.yaml) echo "$p" ;;
esac
' \; | sort
# Inspect ConfigManager.get_prompt naming/method resolution
echo "=== src/config_manager.py (get_prompt) ==="
sed -n '1,220p' src/config_manager.py
# Inspect available languages/methods for ori in config/config.yaml
echo "=== config/config.yaml (languages/methods) ==="
rg -n "languages:|ori:|method:|default:" -n config/config.yaml
sed -n '1,140p' config/config.yaml
# Also search for prompt naming conventions in ConfigManager usage
echo "=== Search for get_prompt( in src ==="
rg -n "get_prompt\(" src || trueRepository: hoichoi-opensource/video-subtitle-generator
Length of output: 497
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== config/prompts/*.yaml ==="
fd -e yaml . --full-path config/prompts --exec echo {} \; | sort
echo "=== Prompt files related to ori ==="
fd -e yaml . --full-path config/prompts --exec sh -c 'p="$0"; case "$p" in *ori*.yaml) echo "$p";; esac' {} \; | sort
echo "=== src/config_manager.py (get_prompt) ==="
sed -n '1,240p' src/config_manager.py
echo "=== config/config.yaml (languages/methods section) ==="
sed -n '1,120p' config/config.yaml
echo "=== Search get_prompt( usage ==="
rg -n "get_prompt\(" src || true
echo "=== Search for prompt method keys (direct/translate) in prompt files ==="
for f in $(fd -e yaml . --full-path config/prompts --exec echo {} \; | sort); do
if rg -n "direct|translate" "$f" >/dev/null 2>&1; then
echo "---- $f ----"
rg -n "direct|translate" "$f" | head -n 50
fi
doneRepository: hoichoi-opensource/video-subtitle-generator
Length of output: 12677
Fix README/prompt mismatch: ori prompt restricts source languages to EN/HI/BN (so Odia-audio “transcription” isn’t actually covered).
config/prompts/ori.yamlinstructs the model to “First understand the audio in English/Hindi/Bengali” before translating to Odia; this same constraint is used by the othermethod: translatelanguage prompts.config/config.yamlconfiguresoriwithmethod: "translate"and there is noconfig/prompts/ori_direct.yaml(andConfigManager.get_promptonly special-caseshin), so there’s no dedicated “Odia audio → Odia subtitles” transcription prompt path.- README calling
ori“AI transcription/translation” doesn’t match the current prompt/config behavior; either broadenorito allow Odia as a source language / add a direct-transcription prompt forori, or update README to state translation-only from EN/HI/BN for non-core languages.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@config/prompts/ori.yaml` at line 5, The ori prompt currently restricts source
languages to English/Hindi/Bengali so there is no Odia→Odia transcription path;
either broaden the existing 'ori' prompt to allow Odia as a source (remove the
"First understand the audio in English/Hindi/Bengali" restriction) or add a new
direct-transcription prompt named 'ori_direct' and update the configuration that
assigns method: "translate" for 'ori' to reference 'ori_direct' for
transcription cases; also update ConfigManager.get_prompt to handle 'ori' like
the existing 'hin' special-case so the new prompt is selected, and revise the
README to accurately describe whether 'ori' supports Odia direct transcription
or only EN/HI/BN→Odia translation.
Pull Request
📝 Description
This PR introduces support for generating subtitles in the Odia language by adding the
ori.yamlconfiguration file. This file contains a structured system prompt that instructs the subtitle generator to accurately interpret audio contexts (across English, Hindi, and Bengali) and translate them into natural Odia script while adhering strictly to SRT timestamp formatting constraints.Additionally, the
README.mdhas been updated to document this new language option.🔗 Related Issue
None
🎯 Type of Change
🧪 Testing
📋 Checklist
📄 Additional Notes
The implementation introduces a new configuration file
ori.yamlcontaining structured LLM system prompts specifically optimized for Odia translation and SRT generation. This establishes standard instructions for cross-lingual understanding (English/Hindi/Bengali to Odia) while strictly maintaining SRT format constraints and natural linguistic expressions.Summary by CodeRabbit