Skip to content

Rosetta: Translation Teams: Give each locale’s team page its own title and canonical URL - #1257

Closed
obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:fix/teams-locale-title-canonical
Closed

obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:fix/teams-locale-title-canonical

Conversation

@obenland

@obenland obenland commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Fixes https://meta.trac.wordpress.org/ticket/4683

A locale’s details page, /polyglots/teams/?locale=xx_YY, has the same <title>, canonical URL and og:url as the all-locales overview, so search engines treat every team page as a duplicate of /polyglots/teams/.

This adds the locale’s English name to the document title (“Translation Teams | Indonesian | Translate WordPress”) and keeps the locale query arg in the canonical URL and Jetpack’s og:url. Unknown locales and en_US, which already 404, are left alone.

The wporg-seo plugin lowercases every canonical URL (https://meta.trac.wordpress.org/ticket/4414), which would turn the canonical into ?locale=id_id, and that currently 404s. So the lookup now ignores case: ?locale=id_id shows the Indonesian page too. No two wp_locale values differ only by case.

The clean /teams/<locale>/ URLs the ticket mentions as a nice-to-have are not part of this.

Testing

  1. Open https://make.wordpress.org/polyglots/teams/?locale=id_ID and view the source.
    • <title> reads “Translation Teams | Indonesian | Translate WordPress”.
    • <link rel="canonical"> is https://make.wordpress.org/polyglots/teams/?locale=id_id.
    • og:url is https://make.wordpress.org/polyglots/teams/?locale=id_ID.
  2. Open https://make.wordpress.org/polyglots/teams/?locale=id_id. It shows the Indonesian team instead of “Locale id_id doesn’t exist.”
  3. Open https://make.wordpress.org/polyglots/teams/. Title, canonical and og:url are unchanged.
  4. Open https://make.wordpress.org/polyglots/teams/?locale=en_US and ?locale=xx_YY. Both still return a 404 with the unchanged title and canonical.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Locale detail pages now show the selected locale’s English name in the page title.
    • Canonical links and Open Graph URLs now include the selected WordPress locale, improving how locale pages are represented when shared or indexed.
    • Locale requests are matched without regard to letter casing.
  • Bug Fixes
    • Invalid locale requests continue to show the existing 404 response, while valid non-English locales display their details.

…e and canonical URL

A locale's details page, /polyglots/teams/?locale=xx_YY, shared the title,
canonical URL and og:url of the all-locales page, so search engines folded
every team page into the overview.

Add the locale's English name to the document title and keep the `locale`
query arg in the canonical URL and og:url. Canonical URLs are lowercased
site-wide (#4414), so the locale lookup now ignores case; otherwise the
canonical would point at a 404.

Fixes #4683.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 12, 2026 21:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland, jonoaldersonwp.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The locale shortcode now uses shared locale lookup helpers. On singular pages containing the shortcode, title, canonical URL, and Jetpack Open Graph filters can apply metadata for a valid non-English locale.

Changes: Locale-aware page metadata

Layer / File(s) Summary
Resolve requested locale
wordpress.org/public_html/wp-content/plugins/wp-i18n-teams/inc/locales.php
The new helpers sanitize and match the requested locale. The shortcode uses the resolved locale and retains its existing 404 path for invalid values.
Apply locale metadata
wordpress.org/public_html/wp-content/plugins/wp-i18n-teams/inc/locales.php
Bootstrap registers title, canonical URL, and Jetpack Open Graph filters. The filters apply locale metadata when the displayed locale and required values are available.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested labels: [Site] Rosetta, [Type] Bug

Suggested reviewers: dd32

Merge Risk: Minimal · up to 48ea0

Locale team pages get their own title and canonical URL, and invalid or English locales still return 404. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: each locale's team page gets its own title and canonical URL. The raw summary confirms the added filters for document title and canonical URL, which match this. The ti…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: each locale's team page gets its own title and canonical URL. The raw summary confirms the added filters for document title and canonical URL, which match this. The title does not mention the case-insensitive locale lookup or Open Graph tags, but those are secondary details. The title is specific and concise, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39290fd2-fd69-411d-a608-5fd4df7e5dc4
Commits

Reviewing files that changed from the base of the PR and between 3946503 and 48ea093.

Files selected for processing: 1

  • wordpress.org/public_html/wp-content/plugins/wp-i18n-teams/inc/locales.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@obenland

Copy link
Copy Markdown
Member Author

@propsbot add jonoalderson

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