docs(theme): explain why the locale prefix hardcodes "en"#135
Conversation
The "en" in the /blog/ URL builder is the frontend's default locale (src/i18n/routing.ts, localePrefix: 'as-needed'), which gets no URL prefix — not Polylang's configured default. Document this so it isn't "fixed" to pll_default_language(), which would diverge from the frontend's routing and app/api/preview/route.ts. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 50 minutes and 23 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Follow-up to #134. CodeRabbit flagged the hardcoded
'en'in the/blog/URL builder and suggestedpll_default_language('slug').That's a false positive: the
'en'is the frontend's default locale (src/i18n/routing.ts→defaultLocale: 'en',localePrefix: 'as-needed'), which gets no URL prefix — not Polylang's configured default. It must mirrorapp/api/preview/route.ts:59so preview and published URLs agree. Usingpll_default_language()would diverge from the frontend's routing if Polylang's default ever differed, producing 404s.This adds a clarifying comment so the intent is explicit and it isn't re-flagged. No behavior change; 342 theme tests still pass.
🤖 Generated with Claude Code