-
-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align exception-translations with translation requirements #2487
Conversation
📝 WalkthroughWalkthroughThe pull request introduces structural changes to the exception message translations in the Home Assistant framework. Specifically, two error messages in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant System
participant ErrorHandler
User->>System: Request to set schedule
System->>ErrorHandler: Validate schedule
alt End date before start date
ErrorHandler-->>System: Raise ServiceValidationError
System-->>User: Return error message (end_date_before_start_date)
else Cannot connect to schedule
ErrorHandler-->>System: Raise HomeAssistantError
System-->>User: Return error message (cannot_connect_to_schedule)
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
docs/core/integration-quality-scale/rules/exception-translations.md (1)
47-52
: LGTM! Consider adding a note about the message structure.The restructuring of error messages to include the "message" key aligns perfectly with Home Assistant's translation requirements. This format ensures proper internationalization support.
Consider adding a brief comment above the JSON example explaining why the messages are structured as objects with a "message" key, as this would help developers understand the reasoning behind this specific format.
`strings.json`: +# Error messages are structured as objects with a "message" key to support +# consistent translation handling across Home Assistant ```json { "exceptions": {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Proposed change
Align with https://developers.home-assistant.io/docs/internationalization/core#exceptions to properly contain
message
(As part of #2484)Type of change
Additional information
Summary by CodeRabbit