-
-
Notifications
You must be signed in to change notification settings - Fork 623
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: add i18n support #2075
base: main
Are you sure you want to change the base?
feat: add i18n support #2075
Conversation
β Live Preview ready!
|
β Live Preview ready!
|
β Deploy Preview for nuxt-content canceled.Built without sensitive environment variables
|
This looks reasonable, I briefly checked the code and it seem to only be built for Document Driven mode. As I think this behavior can easily be achieved via regular prefixed content queries, what do you think in including this in Document Driven mode? We could also move that code somewhere in Docus I guess. |
I don't think Before changing the document driven mode, I believe we need first to have an upgrade of it to avoid using a middleware but a plugin to inject the page to vue-router itself, this way we can leverage payload extraction as well as better i18n support. |
This is why we can not make it in Docus.
The target features:
Just add an online demo here: https://nuxt-content-i18n.vercel.app/, pls check the result @Tahul @atinux |
This issue is extremely important to me, I hope it will be resolved for a moment. Thank you @NftTopBest pr. |
@Tahul @atinux Is that I need another update to make this PR works? |
Any progress? |
Check out the demo here: https://nuxt-content-i18n.vercel.app/ For now, I am not sure what I should do further. |
@NftTopBest I love the implementation, I meant any progress on the maintainers side :) thanks for the quick work, it looks amazing |
I'd like to use that soon. |
Whooo, awesome. Thanks for this! Can't wait to try it in my portfolio because it's currently written in French but many wants to read it in English. |
Hi @farnabaz , is there anything I need to modify for the code? |
Hello @atinux, could you explain more "inject the page to vue-router"? Thanks. |
Hello, I think that the support for i18n could also be add for non DocumentDriven mode. Using ContentDoc, ContentFetch and ContentNavigation. |
Hello, maintainers. May I inquire if there have been any recent updates regarding the timeline for merging this feature? |
Hi ! Thanks a lot for this PR, I hope it will be added to this project soon ! Can we do anything to help things going forward ? @farnabaz ? |
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.
Another change is needed to support i18n : the parseMarkdown() function (L19-L33) should be called with some i18n options for the remark-rehype
plugin :
const parsed = await parseMarkdown(content as string, {
highlight: options.highlight,
remark: {
plugins: config.remarkPlugins
},
rehype: {
options: {
+ footnoteLabel: 'Footprints'
handlers: {
link: link as any
}
},
plugins: config.rehypePlugins
},
toc: config.toc
}
})
βΉοΈ The footnote option is documented here : https://github.com/remarkjs/remark-rehype#fields
The current way to configure without i18n is through the nuxt.config.ts
file with redefining the plugin to force options :
content: {
markdown: {
remarkPlugins: [
['remark-rehype', {
footnoteLabel: 'Footprints'
}]
]
}
},
Any progress on this? |
Any progress on this? x2 |
π Linked issue
i18n feature issue item from docus: nuxt-themes/docus#770
β Type of change
π Description
The PR adds i18n features.
The idea comes from here: nuxt-themes/docus#770
After some more deep digs, I find out the solution is to make a PR here. And nothing to do with the docus project.
playground/i18n
exampledev:i18n
command inpackage.json
π Checklist