Localize release note links on non-English releases pages #3819
+40
−5
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.
Summary
/en/) release posts because thepostURL in_data/releases.ymlis hardcoded to/en/localize_post_urlLiquid 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 otherwiseDetails
The
_data/releases.ymlfile 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_urlfilter (_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/):/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
_plugins/localize_post_url.rb— Liquid filter plugin{ja,ko,uk,vi,zh_cn}/downloads/releases/index.md— uselocalize_post_urlfilter