From 583e57042be4b3a3d444b601f8e3d1279a5a043c Mon Sep 17 00:00:00 2001 From: Adam Mills Date: Fri, 27 Oct 2017 00:46:21 -0400 Subject: [PATCH] Core POC support for polymer i18n (#6344) * Core POC support for polymer i18n * Add gulp to build_frontend * Remove frontend build * Updated translations format * Eliminate translation namespace from panel names * Only register translations path in dev mode --- homeassistant/components/frontend/__init__.py | 4 +++- homeassistant/components/history.py | 2 +- homeassistant/components/logbook.py | 2 +- homeassistant/components/map.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index b1cf267aa8a..1e2bb8ab456 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -276,9 +276,11 @@ def async_setup(hass, config): if is_dev: hass.http.register_static_path("/home-assistant-polymer", repo_path) + hass.http.register_static_path( + "/static/translations", + os.path.join(repo_path, "build/translations")) sw_path = os.path.join(repo_path, "build/service_worker.js") static_path = os.path.join(repo_path, 'hass_frontend') - else: sw_path = os.path.join(frontend_path, "service_worker.js") static_path = frontend_path diff --git a/homeassistant/components/history.py b/homeassistant/components/history.py index c774d838730..55858dbe765 100644 --- a/homeassistant/components/history.py +++ b/homeassistant/components/history.py @@ -245,7 +245,7 @@ def async_setup(hass, config): hass.http.register_view(HistoryPeriodView(filters)) yield from hass.components.frontend.async_register_built_in_panel( - 'history', 'History', 'mdi:poll-box') + 'history', 'history', 'mdi:poll-box') return True diff --git a/homeassistant/components/logbook.py b/homeassistant/components/logbook.py index edd248d940a..63a271acdd5 100644 --- a/homeassistant/components/logbook.py +++ b/homeassistant/components/logbook.py @@ -101,7 +101,7 @@ def setup(hass, config): hass.http.register_view(LogbookView(config.get(DOMAIN, {}))) yield from hass.components.frontend.async_register_built_in_panel( - 'logbook', 'Logbook', 'mdi:format-list-bulleted-type') + 'logbook', 'logbook', 'mdi:format-list-bulleted-type') hass.services.async_register( DOMAIN, 'log', log_message, schema=LOG_MESSAGE_SCHEMA) diff --git a/homeassistant/components/map.py b/homeassistant/components/map.py index 4ad52017600..2b204e584c3 100644 --- a/homeassistant/components/map.py +++ b/homeassistant/components/map.py @@ -13,5 +13,5 @@ DOMAIN = 'map' def async_setup(hass, config): """Register the built-in map panel.""" yield from hass.components.frontend.async_register_built_in_panel( - 'map', 'Map', 'mdi:account-location') + 'map', 'map', 'mdi:account-location') return True