mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Log error and continue on parsing issues of translated strings (#110046)
This commit is contained in:
parent
d3da6cbcfc
commit
d049928be7
@ -273,7 +273,13 @@ class _TranslationCache:
|
|||||||
for key, value in updated_resources.items():
|
for key, value in updated_resources.items():
|
||||||
if key not in cached_resources:
|
if key not in cached_resources:
|
||||||
continue
|
continue
|
||||||
|
try:
|
||||||
tuples = list(string.Formatter().parse(value))
|
tuples = list(string.Formatter().parse(value))
|
||||||
|
except ValueError:
|
||||||
|
_LOGGER.error(
|
||||||
|
("Error while parsing localized (%s) string %s"), language, key
|
||||||
|
)
|
||||||
|
continue
|
||||||
updated_placeholders = {tup[1] for tup in tuples if tup[1] is not None}
|
updated_placeholders = {tup[1] for tup in tuples if tup[1] is not None}
|
||||||
|
|
||||||
tuples = list(string.Formatter().parse(cached_resources[key]))
|
tuples = list(string.Formatter().parse(cached_resources[key]))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user