locale-specific API docs? #317
-
👋 hey, thanks for maintaining Redocusaurus—I'm a big fan! I have a somewhat unusual use case I'm trying to solve for with the docs site I manage, which has to do with Docusaurus's i18n feature and the different locales this feature generates. let me start off by describing what I want to achieve: my goal: for users on different locales (e.g., I don't mind maintaining two different YAML files if need be (e.g., possible approach 1: auto-import docs via
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
This is definitely possible if you create a react page, this is the output - https://redocusaurus.vercel.app/examples/custom-page/ I think you can make this page dynamic and load the correct yaml using docusaurus context ( https://docusaurus.io/docs/docusaurus-core#useDocusaurusContext ) const {i18n} = useDocusaurusContext();
const locale = i18n.currentLocale; This would require specifying all yamls in the docusaurus context without the |
Beta Was this translation helpful? Give feedback.
-
🤩 this looks like exactly what I need! I've definitely seen the output of that "Custom Page" doc before, but I had no idea it was generated via a JSX file. (and thank you so much for the speedy reply 😁) |
Beta Was this translation helpful? Give feedback.
-
@alexakreizinger Did you manually translate the yaml file or did you use a cli, service or plugin? |
Beta Was this translation helpful? Give feedback.
This is definitely possible if you create a react page, this is the output - https://redocusaurus.vercel.app/examples/custom-page/
And this is the source file - https://github.com/rohit-gohri/redocusaurus/blob/main/website/src/pages/examples/custom-page/index.jsx
I think you can make this page dynamic and load the correct yaml using docusaurus context ( https://docusaurus.io/docs/docusaurus-core#useDocusaurusContext )