Skip to content

docs(theme): explain why the locale prefix hardcodes "en"#135

Merged
JohnRDOrazio merged 1 commit into
mainfrom
docs/clarify-default-locale-prefix
May 23, 2026
Merged

docs(theme): explain why the locale prefix hardcodes "en"#135
JohnRDOrazio merged 1 commit into
mainfrom
docs/clarify-default-locale-prefix

Conversation

@JohnRDOrazio
Copy link
Copy Markdown
Member

Follow-up to #134. CodeRabbit flagged the hardcoded 'en' in the /blog/ URL builder and suggested pll_default_language('slug').

That's a false positive: the 'en' is the frontend's default locale (src/i18n/routing.tsdefaultLocale: 'en', localePrefix: 'as-needed'), which gets no URL prefix — not Polylang's configured default. It must mirror app/api/preview/route.ts:59 so preview and published URLs agree. Using pll_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

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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

Warning

Review limit reached

@JohnRDOrazio, we couldn't start this review because you've used your available PR reviews for now.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d8eec19f-ec8c-44ae-a05d-99764b7317a2

📥 Commits

Reviewing files that changed from the base of the PR and between eb9f1b8 and d12e847.

📒 Files selected for processing (1)
  • wordpress/themes/cdcf-headless/includes/frontend-permalinks.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/clarify-default-locale-prefix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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.

@JohnRDOrazio JohnRDOrazio merged commit 45bc660 into main May 23, 2026
12 checks passed
@JohnRDOrazio JohnRDOrazio deleted the docs/clarify-default-locale-prefix branch May 23, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants