Update i18n recipe to use built-in routing - #14304
Conversation
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
|
Preview deployment ✅ Deployment complete!
|
ArmandPhilippot
left a comment
There was a problem hiding this comment.
Hi @hugosmoreira,
First thanks for willing to help but...
We have a PR template so that contributors use it, not so an AI can replace it with whatever it pleases. The fact that your AI runs git diff --check is not important information for maintainers. Explaining what you changed and why you made those changes is more useful.
Also, have you tested your changes, or everything is AI-generated?
Your AI claims it's complete, but it doesn't seem to me. For example:
- we still miss a loader
- you removed the "Translate routes" section, but now the recipe no longer explains to users how to translate them... The current recipe do not translate any slugs.
If some info was missing in the previous recipe, it should be fixed. If we remove a section because there is another way to handle it, we should make sure the recipe still show how to achieve that.
The live recipe has several gaps. Using Astro built-in APIs is nice but I'm not sure that's enough to close that issue.
The purpose of a recipe is to provide step-by-step instructions to achieve a goal that users can adapt to their project. Looking at the end result, this just show users they can switch between two languages:
A real demo of the result achieved with this recipe would be more useful, I think...
|
Thanks for the direct feedback. You're right: I replaced the PR template and described the recipe as complete without verifying the exact instructions end to end. I used an AI assistant to help draft the change, but I'm responsible for reviewing and testing what I submit. I've returned the PR to draft. Before requesting another review, I'll restore the template, add the missing loader, preserve translated-slug support, and follow the complete recipe in a clean project with a runnable reproduction. I'll report only the exact behavior I verified with the revision. |
da064ef to
8e41e1c
Compare
|
Thanks for the direct feedback. You were right: the previous revision and PR description overstated what had actually been verified. Codex assisted with the implementation. For this revision, I reviewed the final one-file diff and kept only claims backed by actual checks. The recipe now includes the missing content loader, preserves translated slugs with an explicit route map ( I generated standalone fixtures from the final snippets and tested the static output, SSR development-server responses, root redirect, localized routes/content/dates, reciprocal language links, and the missing-loader and raw-path-picker failure modes. I also published and browser-checked a fresh-clone reproduction:
I restored the repository's PR template and kept the PR as a draft for review. |
Description (required)
This updates the i18n recipe with a step-by-step English and French example using Astro's built-in routing. It keeps the recipe aligned with current content collections and i18n APIs while preserving translated routes and localized content.
The revision:
Astro.currentLocalefor localized UI and date formatting;/en/about/and/fr/a-propos/;Validation performed:
astro checkwith no errors, warnings, or hints.langattributes, and reciprocalhreflanglinks./→/en/redirect, successful localized responses, translated routes and content, localized dates, reciprocal links, and the expected/fr/about/404.npm ci,astro check, and the static build;npm cireported no vulnerabilities.Live demo: https://hugosmoreira.github.io/astro-i18n-recipe-demo/
Source: https://github.com/hugosmoreira/astro-i18n-recipe-demo
References