Multilanguage support
You can add documentation in other languages by modifying the book-tool
component inside the _preview.html
file and adding a source
tag. Please note that the documentation in other languages must correspond one-to-one with the original content.
<book-tool sw="./sw.js">
<!-- Reference your project configuration file -->
<source src="./en/config.json" lang="en" />
<source src="./cn/config.json" lang="cn" />
<source src="./t-cn/config.json" lang="t-cn" />
<source src="./es/config.json" lang="es" />
</book-tool>
In the above code, we used the source
tag to import documentation configuration files for different language versions. At the same time, the lang
attribute is used to specify the language used in the document. The currently supported language options are as follows:
- English (en)
- Simplified Chinese (cn)
- Traditional Chinese (t-cn)
- Spanish (es)
- Japanese (ja)
- Korean (ko)
By doing this, you can easily provide website content in the corresponding language version for users of different languages.