Skip to content
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

Add missing translations and descriptions for notification fields in UI #132676

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

yazan-abdalrahman
Copy link
Contributor

@yazan-abdalrahman yazan-abdalrahman commented Dec 9, 2024

Proposed change

This PR fixes missing translations in the HTML5 Push Notifications UI action. It adds the action name, description, and translatable fields such as message, title, and target.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link

home-assistant bot commented Dec 9, 2024

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (notify) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of notify can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign notify Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@yazan-abdalrahman
Copy link
Contributor Author

image

Comment on lines 46 to 47
"name": "Notifications 'Send a notification with html5'",
"description": "Sends a notification message using the html5 service.",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd go w/ HTML5 as display term, hm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! You're right—'HTML5' as a display term is more consistent with standard capitalization and naming conventions. I'll update this to reflect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@davidrapan davidrapan left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

@yazan-abdalrahman
Copy link
Contributor Author

LGTM. 👍

Can we merge it?

@davidrapan
Copy link
Contributor

I don't have the write access so you have to wait for someone in charge. 😉

Copy link
Contributor

@abmantis abmantis left a comment

Choose a reason for hiding this comment

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

The notify platform already has a generic message "Send a notification with {self._service_name}" which is also used for the html5 component. Should that be translated instead of adding strings specifically for html5?

@home-assistant home-assistant bot marked this pull request as draft December 12, 2024 16:40
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@yazan-abdalrahman yazan-abdalrahman marked this pull request as ready for review December 23, 2024 12:40
@home-assistant home-assistant bot requested a review from abmantis December 23, 2024 12:40
Copy link
Contributor

@abmantis abmantis left a comment

Choose a reason for hiding this comment

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

@yazan-abdalrahman did you miss my comment in #132676 (review) ?

@home-assistant home-assistant bot marked this pull request as draft December 23, 2024 18:22
@yazan-abdalrahman yazan-abdalrahman changed the title Add missing translations for HTML5 Push Notifications UI Add missing translations and descriptions for notification fields in UI Dec 24, 2024
@yazan-abdalrahman yazan-abdalrahman marked this pull request as ready for review December 24, 2024 10:30
@home-assistant home-assistant bot requested a review from abmantis December 24, 2024 10:30
@yazan-abdalrahman
Copy link
Contributor Author

@yazan-abdalrahman did you miss my comment in #132676 (review) ?

Hi, I saw the comment, and I wrote a new solution, so you can review it?

fix description message "remove 2"
@yazan-abdalrahman
Copy link
Contributor Author

image
image

Copy link
Contributor

@abmantis abmantis left a comment

Choose a reason for hiding this comment

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

The new implementation does not provide a way for the descriptions to be translated. Is that expected?
Also, it would be great if we could have a way to translate the Send a notification via {target_name}" sentence in a generic way (instead of translating it for specific integrations only)

@home-assistant home-assistant bot marked this pull request as draft December 24, 2024 11:51
@yazan-abdalrahman yazan-abdalrahman marked this pull request as ready for review December 25, 2024 15:37
@yazan-abdalrahman
Copy link
Contributor Author

The new implementation does not provide a way for the descriptions to be translated. Is that expected? Also, it would be great if we could have a way to translate the Send a notification via {target_name}" sentence in a generic way (instead of translating it for specific integrations only)

Done. Can you review it?

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.

HTML5 Push Notifications: Partly missing translations in UI
3 participants