Skip to content

Translated a bunch of strings#4137

Merged
bramkragten merged 8 commits into
home-assistant:devfrom
springstan:variousTranslations
Nov 1, 2019
Merged

Translated a bunch of strings#4137
bramkragten merged 8 commits into
home-assistant:devfrom
springstan:variousTranslations

Conversation

@springstan
Copy link
Copy Markdown
Member

Issues affected: #3429

Translated:

  • customization page
  • device table
  • device config page
  • multiple notes in different files (dialog-entity-registry-detail.ts, ha-config-entry-page.ts and ha-logbook.js)
  • confirmation message for custom panels

Results: (showing all translations even errors)
customize
device
devices_table

Comment thread src/panels/custom/ha-panel-custom.ts Outdated
Comment thread src/translations/en.json
Comment on lines +731 to +732
"include_sentence": "It seems that your configuration.yaml doesn't properly",
"include_link": "include customize.yaml",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should bring include to the other key and include the link as a variable in that string.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am not quite sure what you mean by that. Do you want to pass the entire <a> into one translation string?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Like this?

"include_sentence": "It seems that your configuration.yaml doesn't properly {link}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would do:
"include_sentence": "It seems that your configuration.yaml doesn't properly include {customize_link}"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That looks like the way to do it properly 👍

Copy link
Copy Markdown
Member Author

@springstan springstan Oct 29, 2019

Choose a reason for hiding this comment

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

Oddly enough, I cannot pass the entire <a> into the string:

[[localize('ui.panel.config.customize.warning.include_sentence',
          'customize_link',
          '<a
          href="https://www.home-assistant.io/docs/configuration/customizing-devices/#customization-using-the-ui"
          target="_blank"
          >configuration.yaml</a>')]]

Just prints it out like that as the innerHTML of the div element.
Does the localize function filter html elements?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah probably... OK, never mind what I said.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So how should I address this? Just leave it like that or is there any other option?

return html`
<hass-error-screen error="Device not found."></hass-error-screen>
<hass-error-screen
error="${this.hass.localize(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If a value is dynamic you can drop the " around them.

@bramkragten bramkragten merged commit f53eea8 into home-assistant:dev Nov 1, 2019
@bramkragten bramkragten mentioned this pull request Nov 8, 2019
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants