docus icon indicating copy to clipboard operation
docus copied to clipboard

[Integrations] How to translate the docs?

Open otabekoff opened this issue 2 years ago • 14 comments

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? image

otabekoff avatar Jan 20 '23 18:01 otabekoff

@Tahul @bdrtsky

otabekoff avatar Jan 27 '23 16:01 otabekoff

We should start adding i18n to it very soon

atinux avatar Feb 14 '23 14:02 atinux

@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 avatar Mar 01 '23 22:03 jaonoctus

@jaonoctus Is that mean if someone makes a worked PR for the i18n function can get 0.04 BTC?

NftTopBest avatar Mar 18 '23 18:03 NftTopBest

Yessir @NftTopBest

jaonoctus avatar Mar 18 '23 18:03 jaonoctus

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

NftTopBest avatar Mar 19 '23 04:03 NftTopBest

This is very clever @NftTopBest

Maybe you can open a PR to Nuxt Content itself?

atinux avatar Mar 21 '23 10:03 atinux

@NftTopBest ; still interested in landing a PR? Or maybe just a documentation page explaining your setup?

I would happily integrate this in our roadmap.

Tahul avatar May 17 '23 13:05 Tahul

Any progress on the topic or some way to make it work?

truesteps avatar May 19 '23 09:05 truesteps

This is very clever @NftTopBest

Maybe you can open a PR to Nuxt Content itself?

Ok, I will do that!

NftTopBest avatar May 19 '23 15:05 NftTopBest

@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 avatar May 19 '23 15:05 NftTopBest

@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 Screenshot 2023-05-21 at 21 39 49

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

NftTopBest avatar May 21 '23 13:05 NftTopBest

Any progress on this?

Right now I'm duplicating some components just to be able to translate some text.

Thanks.

junogueira avatar Oct 06 '23 23:10 junogueira

bump

truesteps avatar Jun 04 '24 13:06 truesteps