Skip to content
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

[Integrations] How to translate the docs? #770

Open
otabekoff opened this issue Jan 20, 2023 · 14 comments
Open

[Integrations] How to translate the docs? #770

otabekoff opened this issue Jan 20, 2023 · 14 comments
Labels
enhancement New feature or request

Comments

@otabekoff
Copy link

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
Copy link
Author

otabekoff commented Jan 27, 2023

@Tahul @bdrtsky

Copy link
Contributor

atinux commented Feb 14, 2023

We should start adding i18n to it very soon

@jaonoctus
Copy link

jaonoctus commented Mar 1, 2023

@atinux looking forward to this feature.

edit: I'm offering a bounty of 4,000,000 sats (0.04 BTC) for resolving this one 😄

@NftTopBest
Copy link

NftTopBest commented Mar 18, 2023

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

@jaonoctus
Copy link

Yessir @NftTopBest

@NftTopBest
Copy link

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

Copy link
Contributor

atinux commented Mar 21, 2023

This is very clever @NftTopBest

Maybe you can open a PR to Nuxt Content itself?

@Tahul Tahul changed the title How to translate the docs? [Integrations] How to translate the docs? May 17, 2023
@Tahul Tahul added the enhancement New feature or request label May 17, 2023 — with Volta.net
Copy link
Contributor

Tahul commented May 17, 2023

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

I would happily integrate this in our roadmap.

@truesteps
Copy link

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

@NftTopBest
Copy link

This is very clever @NftTopBest

Maybe you can open a PR to Nuxt Content itself?

Ok, I will do that!

@NftTopBest
Copy link

@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
Copy link

NftTopBest commented May 21, 2023

@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: nuxt/content#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: NftTopBest/nuxt-content#1

@junogueira
Copy link

Any progress on this?

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

Thanks.

@truesteps
Copy link

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants