From fda483f4824cd0d72c1b1ecce594eb6abdff260b Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 18 Apr 2019 11:11:43 -0700 Subject: [PATCH] Don't load component when fetching translations (#23196) --- homeassistant/helpers/translation.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/homeassistant/helpers/translation.py b/homeassistant/helpers/translation.py index 24e6f4f390d..4f655e692f7 100644 --- a/homeassistant/helpers/translation.py +++ b/homeassistant/helpers/translation.py @@ -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)