Repository navigation
feat: transcript language picker (23 languages) with script-aware PDFs - #8
Merged
Merged
Conversation
- Web picker + Telegram /language: choose the transcript language; YouTube uses a native track or auto-translates, Vimeo picks the matching uploaded track. Responses say what came back (translated / fallback) and the UI explains it. Language list served from /api/v1/config. - Correct Chinese handling: zh-Hans and zh-Hant no longer treated as equal. - Cache key includes the language. - Translation failures from blocks/timeouts now surface as errors instead of silently returning (and caching) original-language captions. - PDFs: fonts chosen from the actual text. Embedded DejaVu Sans for Latin-extended/Cyrillic/Greek, built-in CID fonts for Chinese/Japanese, embedded Nanum Gothic for Korean; Arabic/Hebrew/Indic/Thai get a clear "PDF not available" (DOCX/TXT still work) instead of broken glyphs. Previously every PDF used Helvetica, so e.g. Polish or Russian text came out as empty boxes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Stacked on #7 (merge order: #5, #6, #7, then this).
Summary
Language picker
GET /api/v1/config, so web, API and bot share one source (app/core/languages.py, 23 languages)./languagecommand and a Language button on/start. The choice is saved with the other preferences, and the ready message shows the language delivered.language/language_name,source_language_name,translatedandlanguage_fallback. The UI shows either "Auto-translated by YouTube from English…" or "Japanese captions weren't available, so this is in English."zh-Hansandzh-Hantare now treated as different languages (before, only the base codezhwas compared). The transcript cache key includes the language.Bug found in a live test: translation errors were caught by a bare
except Exception, so an IP block or timeout during translation quietly returned the original-language captions. The UI would call them "not available", and the result was cached for 72h. Now onlyNotTranslatable/TranslationLanguageNotAvailablefall back. Anything else surfaces as an error and nothing is cached.PDF fonts (existing bug, now much more visible)
Every PDF used plain Helvetica, which only covers Western European characters. Polish, Vietnamese, Russian or Japanese text came out as empty boxes. The font is now chosen from the text itself:
fonts-dejavu-corein Docker)fonts-nanum). ReportLab's Korean CID fonts render blank in PDFium (Chrome's viewer).Only letters decide whether a PDF can be built. Stray symbols a font lacks (emoji,
♪) are dropped, so they never block a PDF.Test plan
fonts-dejavu-core+fonts-nanuminstall, and a Russian/Korean PDF from the container/language→ pick → send a link