mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Catch translation errors (#9299)
This commit is contained in:
parent
528af0157d
commit
92c8bd80b5
@ -86,11 +86,15 @@ export const computeLocalize = async (
|
||||
| undefined;
|
||||
|
||||
if (!translatedMessage) {
|
||||
translatedMessage = new IntlMessageFormat(
|
||||
translatedValue,
|
||||
language,
|
||||
formats
|
||||
);
|
||||
try {
|
||||
translatedMessage = new IntlMessageFormat(
|
||||
translatedValue,
|
||||
language,
|
||||
formats
|
||||
);
|
||||
} catch (err) {
|
||||
return "Translation error: " + err.message;
|
||||
}
|
||||
cache._localizationCache[messageKey] = translatedMessage;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user