docus
docus copied to clipboard
[Integrations] How to translate the docs?
Does Docus provide i18n or anything else to translate the docs into other languages? What about translating texts of theme, like Table of contents
shown in the image shown below?
@Tahul @bdrtsky
We should start adding i18n to it very soon
@Atinux looking forward to this feature.
edit: I'm offering a bounty of 4,000,000 sats (0.04 BTC)
for resolving this one 😄
@jaonoctus Is that mean if someone makes a worked PR for the i18n function can get 0.04 BTC?
Yessir @NftTopBest
wow, after some hours of research, find out that maybe need to modify the code in https://github.com/nuxt/content/blob/main/src/runtime/plugins/documentDriven.ts#L79 that need to pass queryBuilder.param with locale code to query new navigation data to have correct tree data on the aside.
For now I success to make a global middleware to detect the locale from the URL (eg: /en/getting-start or /zh/getter-start) then make something like this
to.meta.documentDriven = {
page: {
_path: to.path,
_locale: 'en'
},
navigation: true
}
can trigger the page query the correct locale content
This is very clever @NftTopBest
Maybe you can open a PR to Nuxt Content itself?
@NftTopBest ; still interested in landing a PR? Or maybe just a documentation page explaining your setup?
I would happily integrate this in our roadmap.
Any progress on the topic or some way to make it work?
This is very clever @NftTopBest
Maybe you can open a PR to Nuxt Content itself?
Ok, I will do that!
@NftTopBest ; still interested in landing a PR? Or maybe just a documentation page explaining your setup?
I would happily integrate this into our roadmap.
ya!! I was just busy on building my Nuxt Layer with web3 features! ;) I will start this issue recently!
@NftTopBest ; still interested in landing a PR? Or maybe just a documentation page explaining your setup?
I would happily integrate this in our roadmap.
Hi @Tahul , I just add the PR here: https://github.com/nuxt/content/pull/2075
Now we can just simply add the config in nuxt.config.ts
to get the i18n feature:
https://github.com/NftTopBest/nuxt-content/blob/564d21ea9090e6a18eb8a3153575c865681b62de/playground/i18n/nuxt.config.ts#L10-L11
You can checkout the i18n example here: https://github.com/NftTopBest/nuxt-content/tree/564d21ea9090e6a18eb8a3153575c865681b62de/playground/i18n
But, it still has a bug that I don't find out the solution, anyone can help? Bug issue here: https://github.com/NftTopBest/nuxt-content/issues/1
Any progress on this?
Right now I'm duplicating some components just to be able to translate some text.
Thanks.
bump