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

Catch translation errors #1928

Merged
merged 1 commit into from
Oct 30, 2018
Merged

Catch translation errors #1928

merged 1 commit into from
Oct 30, 2018

Conversation

bramkragten
Copy link
Member

@bramkragten bramkragten commented Oct 30, 2018

No longer fails the entire page when a placeholder is translated, or translation fails.

Fixes: #1917

try {
return translatedMessage.format(argObject);
} catch (err) {
return "Translation " + err;
Copy link
Member

Choose a reason for hiding this comment

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

What kind of errors would this generate ? And how would that look in the UI?

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Copy link
Member Author

Choose a reason for hiding this comment

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

It ain't pretty, but better than not showing anything at all, and it is an error after all... (we might make it red)

Copy link
Member

Choose a reason for hiding this comment

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

We can't make it red as we only can return strings.

I guess it's fine.

Copy link
Member

Choose a reason for hiding this comment

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

Also someone stop that Dutch translator …

@balloob balloob merged commit 2164b62 into home-assistant:dev Oct 30, 2018
@ghost ghost removed the in progress label Oct 30, 2018
@bramkragten bramkragten deleted the catch-translation-errors branch October 31, 2018 07:49
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants