# Multi-Language Subtitles Implementation Plan > **For Hermes / future AI assistants:** Use `offlineacademy-dev`, `writing-plans`, and `test-driven-development` before implementing this plan. Implement task-by-task on branch `feature/multilang-subtitles`. Do not modify unrelated watch-page sidebar behavior, donation buttons, Docker docs, or quiz features while working on this branch. **Goal:** Add first-class multi-language subtitle support to OfflineAcademy so one video lesson can expose multiple selectable subtitle tracks such as English, Spanish, Japanese, Filipino, Chinese, etc. **Current State:** OfflineAcademy already detects one `.srt` or `.vtt` subtitle file whose base name exactly matches a video file, stores it in `Lesson.subtitlePath`, and renders one hardcoded English `` in `components/VideoPlayer.tsx`. **Target State:** OfflineAcademy detects multiple language-suffixed subtitle files per video, stores them as structured subtitle tracks, renders all tracks in the video player, and provides a clear subtitle selector in the existing player settings menu. **Tech Stack:** Next.js App Router, React client components, Prisma, SQLite, native HTML video `` elements, local course files served through `/api/files/[...path]`. --- ## 1. User-Facing Behavior ### Supported Folder Pattern Preferred pattern: ```text My_Courses/ └── Course Name/ └── Module Name/ ├── 01 - Lesson.mp4 ├── 01 - Lesson.en.vtt ├── 01 - Lesson.es.vtt ├── 01 - Lesson.ja.vtt └── 01 - Lesson.fil.vtt ``` Also accept single-file legacy pattern: ```text 01 - Lesson.mp4 01 - Lesson.vtt ``` Legacy matching should continue to work and should be treated as English unless the implementation can confidently infer otherwise. ### Supported Extensions - `.vtt` — preferred browser-native format. - `.srt` — detected by scanner; should either be served as-is for compatibility or converted/proxied to VTT before being used in ``. ### Language Naming Convention Use language suffixes immediately before the subtitle extension: ```text