Once you are prepared to merge your changes to the repo, please ensure you check out the CONTRIBUTING.md for proper procedures
In our documentation, we implement Docusaurus's i18n Localization feature.
The best way to think about our documentation is as follows:
- Docs/: The "source" documentation where we create new pages and update for the latest changes to our products.
- i18n/: The localized documentation, where the localized files will be stored. Note: These files are part of the .gitignore, so they will only be downloaded at build time. More on how this process works in the localization section below.
Localization is managed with the i18n Docusaurus plugin in conjunction with the Crowdin translation portal.
Our localization works in two parts:
-
i18n Plugin: This plugin loads translated data for each language and allows the user to select their preferred language. It also handles all routing and code adjustments for static React pages in our documentation, as well as generating JSON string files for non-Markdown pages. Additionally, it helps manage translated .md files.
-
Crowdin Translation Portal: This third-party tool assists us in uploading our files to a dedicated platform for hosting translations from the broader community. It also provides a CLI and a crowdin.yml file that is used for configuring file sources and destinations.
Install the required packages
yarn
Start a local development server
yarn start
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
If you are working with different languages, you will need to either:
- Build the server and serve it with
yarn build
&&yarn serve
- Run the dev server for each language with
yarn start -- --locale en
(Replace 'en' with the two letter code of whichever language you are working with)
While the section below may still be useful, it's worth noting that we have automated this process with github actions, now a build will automatically be deployed anytime a push is made to main, as well as once every 24hrs
If you would like to manually deploy for whatever reason you can still use the instructions below.
- Checkout to
main
branch.
git checkout main
- Ensure the build is working on a production build.
yarn build
This command generates static content into the
build
directory and will optimize any links, content, & documents.
- Deploy
main
togh-pages
branch with the below command.
GIT_USER=<Your GitHub username> yarn deploy