Skip to content

Conversation

@littleKitchen
Copy link

Summary

Adds internationalization (i18n) support infrastructure for Thunder documentation using Docusaurus built-in i18n features.

Changes

Configuration (docusaurus.config.ts)

  • Updated i18n config with ISO locale codes (en-US as default)
  • Added locale dropdown to navbar (visible when multiple locales are configured)
  • Added "Help translate" link in dropdown for community contributions

Directory Structure

docs/i18n/
├── README.md                                    # Contribution guidelines
└── en-US/
    ├── docusaurus-plugin-content-docs/current/  # For doc translations
    ├── docusaurus-plugin-content-blog/          # For blog translations
    └── docusaurus-theme-classic/
        ├── navbar.json                          # Navbar strings
        └── footer.json                          # Footer strings

Acceptance Criteria Checklist

  • Enable i18n following the Docusaurus official guides
  • Use ISO Local Codes (<LANG>-<COUNTRY>) - configured as en-US
  • Configure a default language (en-US)
  • Structure docs to allow locale-specific translations
  • Allow community-driven translations via pull requests (README added)
  • Update CI to enforce localized content structure (separate PR recommended)

How to Add New Languages

  1. Add locale to docusaurus.config.ts:
locales: ['en-US', 'es-ES'], // Add new locale
localeConfigs: {
  'es-ES': {
    label: 'Español',
    direction: 'ltr',
    htmlLang: 'es-ES',
  },
},
  1. Copy i18n/en-US to i18n/<new-locale>
  2. Translate the content files
  3. Submit a PR

Testing Notes

⚠️ Build Note: There are pre-existing duplicate sidebar translation keys in the codebase (e.g., "Flow Management", "Overview") that cause build failures when i18n is enabled. These are unrelated to this PR and should be fixed separately by adding unique key attributes to sidebar items per Docusaurus i18n docs.

The i18n configuration itself is correct and follows Docusaurus best practices.

Resources

Closes #1251

Enable internationalization (i18n) support for Thunder documentation
using Docusaurus built-in i18n features.

Changes:
- Configure i18n in docusaurus.config.ts with ISO locale codes (en-US)
- Add locale dropdown to navbar (visible when multiple locales configured)
- Create i18n directory structure for translations
- Add README.md with contribution guidelines for translators
- Add initial en-US theme translation files (navbar.json, footer.json)

The infrastructure is now ready for:
- Community-driven translations via pull requests
- Adding new locales by copying en-US structure
- MDX content translation
- React component i18n support

Note: When adding this to existing builds, some sidebars may need unique
translation keys to avoid conflicts. See Docusaurus i18n docs for details.

Closes asgardeo#1251
Copy link
Member

@brionmario brionmario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @littleKitchen,

Thanks for the contribution.

Can you please explain the overall approach you took here?

I see you've attempted to translate the NavBar,
What's you plan / approach for content translation?

Cheers 🙌

@littleKitchen
Copy link
Author

Hi, thanks for the review!

NavBar/Footer are translated first because they're "theme strings" handled separately from content (standard first step per Docusaurus docs).

For content translation: it's designed to be community-driven. Contributors can copy the i18n/en-US/ folder, translate, and submit PRs. I added a README with guidelines.

The infrastructure is ready - actual translations can be added incrementally as volunteers step up.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] Localization (i18n) support for Thunder Documentation

2 participants