Repository navigation
chore(release): v1.23.0 — locale-aware theme content pages (restore per-locale marketing) - #340
Merged
Merged
Conversation
…ting) A theme's content/<slug>.phtml pages were resolved by slug only, so the whole public site rendered English in every locale — the regression from TIGER-230, which lifted the marketing pages (and their per-locale .<locale>.phtml siblings, resolved by Tiger_View_Helper_LocaleView) out of core into the TigerMarketing theme but left the theme-content path locale-blind. Add Tiger_Theme::contentFile($slug, $dir, $lang) — the theme sibling of the localeView helper: it serves content/<slug>.<LANG>.phtml when the theme ships that translation, else the base content/<slug>.phtml. The base English page is required (a lone locale file is an orphan), the same strict dot-free slug guard as template()/ThemeContent prevents traversal, and the locale is injectable for testing (defaults to the request's LANG). PageController::themeContentAction resolves through it, so a translated page — and its hint title — renders fully in-locale; the dispatch gates already require the base file, which always ships. 9 unit cases (variant hit incl. tlh, base fallback, orphan-variant, nested slug, traversal/bad-slug refusal, bogus locale, explicit dir). The matching translated content files ship in TigerMarketing (v1.0.2). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ
New @api Tiger_Theme::contentFile() — a backward-compatible addition — so this is a minor bump. Ships the locale-aware theme content resolution that restores the per-locale marketing pages (TIGER-325). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ
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.
Problem
A theme's
content/<slug>.phtmlpages were resolved by slug only, so the public marketing site rendered English in every locale. This is the regression from TIGER-230, which lifted the marketing pages out of core into the TigerMarketing theme. In core those pages were per-locale sibling view scripts (index/<slug>.<locale>.phtml, resolved byTiger_View_Helper_LocaleView); the extraction carried only the base English files and left the theme-content render path locale-blind.Fix
Tiger_Theme::contentFile($slug, $dir = null, $lang = null)— the theme sibling oflocaleView:content/<slug>.<LANG>.phtmlwhen the theme ships that translation, else the basecontent/<slug>.phtml;template()/ThemeContent(no traversal out ofcontent/);$lang) for testing, defaulting to the request'sLANG.PageController::themeContentActionresolves through it, so a translated page and its hint title render fully in-locale. The dispatch gates (ThemeContentplugin,IndexController::indexAction, the theme-page forward) already require the base file, which always ships — so this only changes which file renders, never dispatchability.Tests
tests/Unit/Theme/ThemeContentFileTest.php— 9 cases: locale-variant hit (incl. 3-lettertlh), base fallback, orphan-variant refusal, nested slug, traversal / bad-slug refusal, bogus-locale ignore, explicit dir override.Companion
The recovered translated content files (56: es/fr/de/hi/pt × 11 pages + the Klingon home) ship in TigerMarketing v1.0.2. Together they restore the real multilingual marketing site — including the grammatical tlhIngan Hol / pIqaD home.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ