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
This commit is contained in:
parent
9d0c2a8dae
commit
583e57042b
4 changed files with 6 additions and 4 deletions
|
@ -276,9 +276,11 @@ def async_setup(hass, config):
|
||||||
|
|
||||||
if is_dev:
|
if is_dev:
|
||||||
hass.http.register_static_path("/home-assistant-polymer", repo_path)
|
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")
|
sw_path = os.path.join(repo_path, "build/service_worker.js")
|
||||||
static_path = os.path.join(repo_path, 'hass_frontend')
|
static_path = os.path.join(repo_path, 'hass_frontend')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
sw_path = os.path.join(frontend_path, "service_worker.js")
|
sw_path = os.path.join(frontend_path, "service_worker.js")
|
||||||
static_path = frontend_path
|
static_path = frontend_path
|
||||||
|
|
|
@ -245,7 +245,7 @@ def async_setup(hass, config):
|
||||||
|
|
||||||
hass.http.register_view(HistoryPeriodView(filters))
|
hass.http.register_view(HistoryPeriodView(filters))
|
||||||
yield from hass.components.frontend.async_register_built_in_panel(
|
yield from hass.components.frontend.async_register_built_in_panel(
|
||||||
'history', 'History', 'mdi:poll-box')
|
'history', 'history', 'mdi:poll-box')
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ def setup(hass, config):
|
||||||
hass.http.register_view(LogbookView(config.get(DOMAIN, {})))
|
hass.http.register_view(LogbookView(config.get(DOMAIN, {})))
|
||||||
|
|
||||||
yield from hass.components.frontend.async_register_built_in_panel(
|
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(
|
hass.services.async_register(
|
||||||
DOMAIN, 'log', log_message, schema=LOG_MESSAGE_SCHEMA)
|
DOMAIN, 'log', log_message, schema=LOG_MESSAGE_SCHEMA)
|
||||||
|
|
|
@ -13,5 +13,5 @@ DOMAIN = 'map'
|
||||||
def async_setup(hass, config):
|
def async_setup(hass, config):
|
||||||
"""Register the built-in map panel."""
|
"""Register the built-in map panel."""
|
||||||
yield from hass.components.frontend.async_register_built_in_panel(
|
yield from hass.components.frontend.async_register_built_in_panel(
|
||||||
'map', 'Map', 'mdi:account-location')
|
'map', 'map', 'mdi:account-location')
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Reference in a new issue