Skip to content

feat: Add multilingual README support#4964

Closed
rosch100 wants to merge 1 commit intohacs:mainfrom
rosch100:main
Closed

feat: Add multilingual README support#4964
rosch100 wants to merge 1 commit intohacs:mainfrom
rosch100:main

Conversation

@rosch100
Copy link

@rosch100 rosch100 commented Dec 1, 2025

Description

This PR adds support for multilingual README files in the HACS backend.

Changes

  • ✅ Extended websocket handler: Optional language parameter for hacs/repository/info
  • ✅ Implemented new method async_get_info_file_contents_with_language
  • ✅ Support for language-specific README files (e.g., README.de.md, README.fr.md)
  • ✅ Automatic fallback to README.md if language-specific version doesn't exist
  • ✅ Language code validation (2-letter ISO 639-1)
  • ✅ Fully backward compatible

Frontend Status

⚠️ Note: A corresponding pull request for the frontend will be issued separately. The frontend implementation is not yet completed, but this backend implementation is ready and will work once the frontend PR is merged.

Supported File Formats

  • README.md - Standard (English or fallback)
  • README.{language}.md - Language-specific (e.g., README.de.md, README.fr.md)

Testing

The implementation has been tested and is fully backward compatible. Old frontend versions without the language parameter continue to work.

References

- Add optional language parameter to hacs/repository/info websocket command
- Implement async_get_info_file_contents_with_language method
- Support language-specific README files (README.{language}.md)
- Fallback to README.md if language-specific version not found
- Validate language codes (2-letter ISO 639-1)
- Fully backward compatible
rosch100 pushed a commit to rosch100/frontend that referenced this pull request Dec 1, 2025
- Add language code extraction from BCP47 format
- Implement automatic language detection based on hass.language
- Add backend support detection with intelligent caching
- Update repository dashboard and download dialog to pass language
- Add automatic reload when language changes
- Fully backward compatible with graceful degradation
- Add comprehensive documentation and testing guides

Related backend PR: hacs/integration#4964
@rosch100
Copy link
Author

rosch100 commented Dec 1, 2025

Closed in favor of PR #4965 which uses a proper feature branch instead of main branch.

@rosch100 rosch100 closed this Dec 1, 2025

return await self.get_documentation(filename=info_files[0], version=version) or ""

async def async_get_info_file_contents_with_language(
Copy link
Member

Choose a reason for hiding this comment

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

If this is being added, supported languages needs to be declared in hacs.json
This then needs to be validated on repository registration and with the HACS action.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants