1
mirror of https://github.com/home-assistant/core synced 2024-09-06 10:29:55 +02:00

Don't load component when fetching translations (#23196)

This commit is contained in:
Paulus Schoutsen 2019-04-18 11:11:43 -07:00 committed by GitHub
parent c2cce13e2a
commit fda483f482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,11 +52,9 @@ async def component_translation_file(hass: HomeAssistantType, component: str,
filename = "{}.{}.json".format(parts[0], language)
return str(integration.file_path / '.translations' / filename)
module = integration.get_component()
# If it's a component that is just one file, we don't support translations
# Example custom_components/my_component.py
if module.__name__ != module.__package__:
if integration.file_path.name != domain:
return None
filename = '{}.json'.format(language)