Skip to content

Commit

Permalink
Remove i18n switcher and build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher committed Mar 5, 2025
1 parent ddf50e1 commit 7b4a2c4
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 351 deletions.
3 changes: 0 additions & 3 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@ yarn-error.log*
/src/tests.ok
/src/cli/usage.md
/src/.gitbook/assets/*.svg

# i18n gets generated by write-translations & Crowdin
i18n
55 changes: 0 additions & 55 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ This build script will also:

- generate the `cli/usage.md` document from the output of each of the Solana CLI commands and sub-commands
- convert each of the `art/*.bob` files into SVG images used throughout the docs
- generate the language [Translations](#translations)

> Note: Running this build script is **required** before being able to run the site locally via the `npm run start` command since it will generate the `cli/usage.md` document.
Expand All @@ -61,60 +60,6 @@ npm run start

> Note: Most changes are reflected live without having to restart the server or refresh the page. However, some changes may require a manual refresh of the page or a restart of the development server (via the command above).
## Translations

Translations are sourced from [Crowdin](https://docusaurus.io/docs/i18n/crowdin)
and generated when the branch noted as the `STABLE` channel is built via the
`build.sh` script.

For local development, and with the `CROWDIN_PERSONAL_TOKEN` env variable set,
use the following two commands in this `docs` directory.

To download the newest documentation translations run:

```sh
npm run crowdin:download
```

To upload changes from `src` & generate
[explicit IDs](https://docusaurus.io/docs/markdown-features/headings#explicit-ids):

```shell
npm run crowdin:upload
```

> Translations are only included when deploying the `STABLE` channel of the docs
> (via `build.sh`). Resulting in only the `docs.solanalabs.com` documentation
> site to include translated content. Therefore, the `edge` and `beta` docs
> sites are not expected to include translated content, even though the language
> selector will still be present.
### Common issues

#### `CROWDIN_PERSONAL_TOKEN` env variable

The `crowdin.yml` file requires a `CROWDIN_PERSONAL_TOKEN` env variable to be
set with a valid Crowdin access token.

For local development, you can store this in a `.env` file that the Crowdin CLI
will auto detect.

For building and publishing via the GitHub actions, the `CROWDIN_PERSONAL_TOKEN`
secret must be set.

#### Translation locale fails to build with `SyntaxError`

Some translation locales may fail to build with a `SyntaxError` thrown by
Docusaurus due to how certain language symbols get parsed by Docusaurus while
generating the static version of the docs.

> Note: When any locale fails to build, the entire docs build will fail
> resulting in the docs not being able to be deployed at all.
There are several known locales that fail to build the current documentation.
They are listed in the commented out `localesNotBuilding` attribute in the
[`docusaurus.config.js`](https://github.com/solana-labs/solana/blob/master/docs/docusaurus.config.js)

## CI Build Flow

The docs are built and published in Github Actions with the `docs.yml` workflow. On each PR, the docs are built, but not published.
Expand Down
25 changes: 0 additions & 25 deletions docs/crowdin.yml

This file was deleted.

29 changes: 0 additions & 29 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,6 @@ module.exports = {
crossorigin: "anonymous",
},
],
i18n: {
defaultLocale: "en",
locales: ["en", "de", "es", "ru", "ar"],
// localesNotBuilding: ["ko", "pt", "vi", "zh", "ja"],
localeConfigs: {
en: {
label: "English",
},
ru: {
label: "Русский",
},
es: {
label: "Español",
},
de: {
label: "Deutsch",
},
ar: {
label: "العربية",
},
ko: {
label: "한국어",
},
},
},
themeConfig: {
prism: {
additionalLanguages: ["rust"],
Expand Down Expand Up @@ -81,10 +56,6 @@ module.exports = {
},
],
},
{
type: "localeDropdown",
position: "right",
},
{
href: "https://solana.com/discord",
// label: "Discord",
Expand Down
Loading

0 comments on commit 7b4a2c4

Please sign in to comment.