Skip to content

Localize release note links on non-English releases pages#3819

Open
runlevel5 wants to merge 1 commit intoruby:masterfrom
runlevel5:localize-release-post-urls
Open

Localize release note links on non-English releases pages#3819
runlevel5 wants to merge 1 commit intoruby:masterfrom
runlevel5:localize-release-post-urls

Conversation

@runlevel5
Copy link
Member

Summary

  • The releases pages for non-English languages (ja, ko, uk, vi, zh_cn) always linked to English (/en/) release posts because the post URL in _data/releases.yml is hardcoded to /en/
  • Added a localize_post_url Liquid filter plugin that checks whether a translated post exists for the current page's language, linking to it when available and falling back to the English URL otherwise
  • Updated all 5 non-English releases page templates to use the new filter

Details

The _data/releases.yml file stores a single canonical URL per release (e.g. /en/news/2025/12/25/ruby-4-0-0-released/). Previously, all releases pages rendered this URL verbatim, meaning users on non-English pages were always directed to the English release post — even when a translation existed.

The new localize_post_url filter (_plugins/localize_post_url.rb) replaces /en/ with the current page's language prefix and checks against Jekyll's known posts. If the localized post exists, the link points there; otherwise it falls back to /en/.

Example

On the Vietnamese releases page (/vi/downloads/releases/):

Before After
/en/news/2025/12/25/ruby-4-0-0-released/ /vi/news/2025/12/25/ruby-4-0-0-released/ (translation exists)
/en/news/2026/01/13/ruby-4-0-1-released/ /en/news/2026/01/13/ruby-4-0-1-released/ (no translation, falls back)

Files changed

  • New: _plugins/localize_post_url.rb — Liquid filter plugin
  • Modified: {ja,ko,uk,vi,zh_cn}/downloads/releases/index.md — use localize_post_url filter

The releases pages for non-English languages (ja, ko, uk, vi, zh_cn)
always linked to the English (/en/) release posts because the post URL
in _data/releases.yml is hardcoded to /en/.

Add a localize_post_url Liquid filter plugin that checks whether a
translated post exists for the current page language. If a translation
is found, the link points to the localized post; otherwise it falls
back to the original English URL.
@runlevel5 runlevel5 requested review from a team as code owners February 7, 2026 15:39
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.

1 participant