Skip to content

Show English for untranslated files - #12909

Closed
iHiD wants to merge 1 commit into
mainfrom
content-english-fallback
Closed

iHiD wants to merge 1 commit into
mainfrom
content-english-fallback

Conversation

@iHiD

@iHiD iHiD commented Nov 7, 2026

Copy link
Copy Markdown
Member

When a locale had no translation of a file, Git::Repository#read_translated_text_blob returned "", so the page rendered blank. Untranslated track docs at /docs/tracks/<slug>/* in Hungarian were one example. Exercise instructions, hints, blog posts and analyzer comments go through the same method.

It now returns the English, as names and blurbs already do since #10686. It reuses the blob id it already found, so it does not walk the tree twice. A file that has no English still renders empty.

The miss is still reported to Sentry. read_translated_text_blob takes a new report_missing: keyword, and Document#markdown passes translation_expected?, so docs on inactive tracks no longer report. Exercise, concept and track content still always report, because those git objects do not know whether their track is active.

Nothing caches the English fallback beyond the request. ETags and fragment caches include TranslationRepo.cache_key, which changes when a translation lands. translated? and Solution::ResolveDocs are unchanged.

Tests in test/models/git/translated_content_test.rb cover a present translation, a missing one (English plus a report), report_missing: false, a missing English file, and docs on active and inactive tracks.

Refs exercism/i18n#237. That issue stays open for Document#nav_title, which shows an untranslated database value.

🤖 Generated with Claude Code

When a locale had no translation of a file, read_translated_text_blob
returned "", so pages such as untranslated track docs rendered blank. It
now returns the English, as names and blurbs already do since #10686. The
miss is still reported, except for docs on inactive tracks.

Refs exercism/i18n#237.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iHiD
iHiD force-pushed the content-english-fallback branch from be31bc9 to 803f888 Compare November 8, 2026 04:06
@iHiD iHiD added the ready-to-translate The English in this PR is final; queue its translations label Nov 8, 2026
@iHiD

iHiD commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Closing. A missing translation should be fixed by translating it, and the miss reported. Falling back to English hides it, and English doesn't help a reader who doesn't speak it.

@iHiD iHiD closed this Nov 8, 2026
@iHiD
iHiD deleted the content-english-fallback branch November 8, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-translate The English in this PR is final; queue its translations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant