Skip to content

[WIP] Multilingual support prototype - #1191

Draft
bact wants to merge 3 commits into
spdx:developfrom
bact:multilingual
Draft

[WIP] Multilingual support prototype#1191
bact wants to merge 3 commits into
spdx:developfrom
bact:multilingual

Conversation

@bact

@bact bact commented Apr 10, 2025

Copy link
Copy Markdown
Collaborator

This PR is not meant for merge. Just only for convenient code comparison.

  • Please focus on mkdocs.yml and overall location of content files.
  • This is not work yet with the GitHub CI but can be used to build the site using instructions in build.md
  • The content changes and changes in directory locations should be in another separate PRs.

This is what we can have now for internationalisation (i18n) support of the spec website, using mkdocs-static-i18n plugin with MkDocs, see the demo site:

For content without translation, it will fallback to English one.

Note that there is no language selector yet. To switches between languages, one needs to add the language code to the URL manually:

(Japanese is chosen for testing purpose because we have some test content in both spdx-spec and spdx-3-model sides)

The demo content is from spdx-spec and spdx-3-model repos combined, based on these PRs/issues:

Configuration

The configuration in mkdocs.yml uses folder structure option of mkdocs-static-i18n (see i18n section in the config file).

See the documentation here: https://ultrabug.github.io/mkdocs-static-i18n/setup/

Unresolved issues

As I still have issues having mike working with the i18n plugin, the multiple version builds (3.0.1, 3.1-dev, etc) is not ready.

When mike is trying to copy "version-select.css" file from a translated site, it will find that the file is already existed (from the English website), and it will stop with this error message:

ERROR   -  'css/version-select.css' is already included in 'extra_css'

Update: a small hack made possible to build mike with i18n now, but I'm not sure if it's a right way to do it. An issue is filed here: jimporter/mike#240

bact added 2 commits April 9, 2025 20:04
Add internationalisation (i18n) support:

- Use mkdocs-static-i18n plugin for MkDocs
- Use "folder" structure (one folder for one language)

Currently does not work with mike (versions) yet.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact added the website improvement Area where the project website needs fixing label Apr 10, 2025
@bact
bact marked this pull request as draft April 10, 2025 12:40
Since JSON context may not be available yet at https://spdx.org/ at the time of model development,
this PR will tell JSON Schema generator to use the JSON context URL at https://spdx.github.io/spdx-spec/ instead.

For released versions, the URL will be switched to the https://spdx.org/ one.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact added this to the release-independent milestone Jun 12, 2025
@bact

bact commented Sep 29, 2025

Copy link
Copy Markdown
Collaborator Author

Alternatively, Materials theme for MkDocs supports multilingual site out-of-the-box. We can use that as well.

See: https://squidfunk.github.io/mkdocs-material/setup/changing-the-language/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

website improvement Area where the project website needs fixing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant