-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(astro:i18n): add docs for some missing public utilities #12264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(astro:i18n): add docs for some missing public utilities #12264
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
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
|
|
Thank you so much, @ArmandPhilippot ! I'm going to ask @ematipico to review this, make sure everything here should be in docs etc. before I look too closely! 🙌 |
|
Noting that Ema is on a few weeks of holidays right now, so we'll get around to this one, eventually! 😄 |
HiDeoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, great catch 🕵️
We talked about it during T&D with Ema, and here is a brief overview of the action items we decided would be the best:
- We want to document them
- Looks like
normalizeThePathis missing? - The actual code should be moved away from internal code (this is a re-export)
- The actual code should be enhanced with some JSDoc and better documentation
The last 2 points should be done in the Astro repo.
|
Good catch, we definitely only want to document what is public, I probably got confused during the T&D call.
May need to double check if Ema had a specific idea in mind, but I guess the idea was to move public code away from |
HiDeoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some extra thoughts that came to mind after T&D, mostly around trying to make the examples more obvious when such APIs could be useful. Let me know what you think.
Co-authored-by: HiDeoo <[email protected]>
|
When y'all are happy with this, no need to wait for me! |
|
Noted, thanks! I was waiting for the core's PR because this is new content but if you don't see anything wrong here, then I guess it's safe to merge it with Ema and Yan approval! 😄 |
yanthomasdev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Since no one else has intervened since Yan's approval, I guess everyone is happy and this one is ready to be merged! If not, you still have time while the branch is updating. 😄 |
Description (required)
The
i18nNoLocaleFoundInPatherror suggests to use thepathHasLocalehelper... but I couldn't find it in the docs. Actually we're missing a few utilities in theastro:i18nreference.Adds documentation for:
normalizeTheLocale()(sinceastro:i18nrelease? Maybe this was made public later but I couldn't find a PR suggesting this)pathHasLocale()(added in 4.6.0, feat(i18n): manual routing astro#10193)toCodes()(added in 4.0.0, feat(i18n): refined locales astro#9200)toPaths()(added in 4.0.0, feat(i18n): refined locales astro#9200)I'm not quite sure about the use cases, so I added examples based on the
getPathByLocale()one.Related issues & labels (optional)