【发布时间】:2022-12-01 22:25:57
【问题描述】:
I have i18n perfectly setup and working for themes and plugins of a Docusaurus website.
But for the homepage, I have a component Foo.js located in src/components/Foo.js.
It contains a const Bar = 'happy';
Is a text string that will be part of the HTML returned by the component and I want it translated.
I guess it should be possible; in the documentation is stated:
JSON is used to translate: Your React code: standalone React pages in src/pages, or other components
and
code.json # Any text label present in the React codeThe
Bartext is not extracted withdocusaurus write-translations.Should I add manually to
code.json? If yes, which is the correct key to use?Thank you in advance for your help.
【问题讨论】:
标签: internationalization docusaurus