Skip to content

Conversation

@jbouwh
Copy link
Contributor

@jbouwh jbouwh commented Oct 22, 2025

Proposed change

Introducing description placeholders for service action translations.
Blog post added

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features for which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Remove stale or deprecated documentation

Checklist

  • I have read and followed the documentation guidelines.
  • I have verified that my changes render correctly in the documentation.

Additional information

Summary by CodeRabbit

  • Documentation
    • Added a blog post explaining how to use translation placeholders in custom service action descriptions.
    • Updated service action registration docs with an example showing optional description placeholders and how to supply them.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

📝 Walkthrough

Walkthrough

Adds a blog post announcing translation-placeholder support for service action descriptions and updates documentation to show how to supply optional description_placeholders when registering service actions.

Changes

Cohort / File(s) Summary
Blog post
blog/2025-10-22-service-translation-placeholders.md
New blog post introducing translation-placeholder support for (custom) service action descriptions, including front matter and usage guidance for description placeholders.
Documentation update
docs/core/integration-quality-scale/rules/action-setup.md
Updated docs to note optional description_placeholders when registering a service action; code example now includes description_placeholders={"example_url": "https://schedule.example.com"} and the fenced code block range expanded from {13-19} to {13-20}.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Introducing description placeholders for service action translations" directly corresponds to the main change in the pull request, which adds support for description placeholders in service action translations. The title is concise, clear, and specific without unnecessary noise or vague language. It accurately conveys the primary feature being introduced across both the blog post and documentation updates included in the changeset.
Description Check ✅ Passed The pull request description follows the required template structure with all major sections addressed. The proposed change section is present and communicates the essence of the changes, though relatively brief. The type of change is properly selected with only one box checked as required, the checklist items are completed with both items marked as done, and the additional information section includes a link to the related core pull request (#154984). While the "fixes" field lacks a specific issue number, the PR properly references the relevant code change that motivated the documentation updates.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch service-action-description-placeholders

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 81dc571 and e673464.

📒 Files selected for processing (1)
  • blog/2025-10-22-service-translation-placeholders.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • blog/2025-10-22-service-translation-placeholders.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - developers-home-assistant
  • GitHub Check: Header rules - developers-home-assistant
  • GitHub Check: Pages changed - developers-home-assistant

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 39bb544 and 81dc571.

📒 Files selected for processing (2)
  • blog/2025-10-22-service-translation-placeholders.md (1 hunks)
  • docs/core/integration-quality-scale/rules/action-setup.md (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
*/**(html|markdown|md)

⚙️ CodeRabbit configuration file

*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

*/**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

  • Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

  • Use sentence-style capitalization also in headings.

do not comment on HTML used for icons

Avoid flagging inline HTML for embedding videos in future reviews for this repository.

Files:

  • blog/2025-10-22-service-translation-placeholders.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - developers-home-assistant
  • GitHub Check: Header rules - developers-home-assistant
  • GitHub Check: Pages changed - developers-home-assistant
🔇 Additional comments (2)
blog/2025-10-22-service-translation-placeholders.md (1)

1-6: Front matter structure is correct.

docs/core/integration-quality-scale/rules/action-setup.md (1)

28-28: Code example correctly demonstrates the new parameter.

The code block range update and new description_placeholders parameter are correctly placed and formatted. The example with {"example_url": "https://schedule.example.com"} provides clear, realistic guidance.

Also applies to: 47-47


The [service action example](/docs/core/integration-quality-scale/rules/action-setup?_highlight=hass.services.async_register#example-implementation) now shows how to supply the available description place holders during the registration of the service action.

URLs that are part of the service transaction should be moved out of the service descriptions and translation strings using the description placeholders.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clarify terminology and destination for moving URLs.

Line 11 uses "service transaction," which is non-standard; services are not typically called "transactions." Additionally, the phrasing "moved out of...using" obscures where URLs should go. Revise to clarify that URLs belong in description placeholders.

-URLs that are part of the service transaction should be moved out of the service descriptions and translation strings using the description placeholders.
+Move URLs from service descriptions and translation strings into description placeholders.

This revision uses direct phrasing per documentation guidelines and clarifies the intended action.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
URLs that are part of the service transaction should be moved out of the service descriptions and translation strings using the description placeholders.
Move URLs from service descriptions and translation strings into description placeholders.
🤖 Prompt for AI Agents
In blog/2025-10-22-service-translation-placeholders.md around line 11, update
the sentence that currently says "service transaction" and "moved out of the
service descriptions and translation strings using the description placeholders"
to be explicit and unambiguous: replace "service transaction" with "service
descriptions" (or "service definitions") and rewrite the clause to say that any
URLs must be placed in description placeholders (not embedded in service
descriptions or translation strings) and that translation strings should
reference those placeholders; make the phrasing direct and simple per
documentation guidelines.

In this example, the service call requires a configuration entry id as parameter.
This is used to first fetch the configuration entry, and then check if it is loaded.
If the configuration entry does not exist or the configuration entry that we found is not loaded, we raise a relevant error which is shown to the user.
Optional description placeholders can be supplied.
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Expand explanation to introduce what description placeholders are.

Line 25 introduces description placeholders but provides no context about their purpose. Readers will encounter the term before the code example and need to understand why they're useful (e.g., for translations and externalized configuration). Revise to be more informative.

-Optional description placeholders can be supplied.
+Supply description placeholders to enable translation of service parameters—for example, to reference external resources like documentation URLs that need to be localized or updated independently of the service description.

Alternatively, combine the explanation with the code block introduction:

-Optional description placeholders can be supplied.
-
-`__init__py`:
```python {13-20} showLineNumbers
+`__init__py`:
+
+Use the `description_placeholders` parameter to supply translatable values, such as URLs:
+
```python {13-20} showLineNumbers

Either approach makes the feature's purpose clear before the code example.

🤖 Prompt for AI Agents
docs/core/integration-quality-scale/rules/action-setup.md around line 25: the
phrase "Optional description placeholders can be supplied." is too terse and
lacks context; replace or expand it to briefly define what description
placeholders are (tokens used to supply translatable/externalized values into
action descriptions), state common use cases (e.g., translations, injecting URLs
or config values), and suggest where to pass them (e.g., via a
description_placeholders parameter) and why that matters; optionally merge this
explanation into the code-block introduction so readers see both the purpose and
an immediate example of using description_placeholders with translatable values
like URLs.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant