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

chore-cleanup-translations #242

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

EdLeckert
Copy link
Collaborator

Cleanup of translations and minor adjustments. Looks worse than it is because strings.json was overwritten (and can be ignored).

  1. While I couldn't find a definitive reference in the "official" docs, the consensus seems to be that strings.json should be exactly the same as the primary language in the translations folder, en.json. This is probably for backward compatibility, and the duplicate hopefully can eventually go away. Have copied en.json to strings.json.
  2. Error strings do not get translated in non-core integrations. Converted them to the text in core: homeassistant/strings.json
  3. Slightly out of scope, but errors for badly formatted URLs during config flow were falling thru to the generic Exception and getting displayed as "Unexpected exception". Now trap the aiohttp InvalidURL exception and display message showing example formatting.

Here's the existing behavior for a "cannot_connect" error, as in wrong IP address:

NotTranslated

New behavior:

FailedToConnect

Also for invalid url formatting:

URLIsMalformed

Finally, invalid authentication:

InvalidAuthentication

Let me know what you think.

@sonarcloud
Copy link

sonarcloud bot commented Aug 22, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Owner

@vinteo vinteo left a comment

Choose a reason for hiding this comment

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

I was hoping they would "fix" the error code translation in non core but its been years and they haven't done it so I guess we just have to copy it which is a shame.

@vinteo vinteo merged commit d09ae30 into vinteo:master Aug 23, 2023
7 checks passed
@EdLeckert EdLeckert deleted the chore-cleanup-translations branch August 23, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants