Translated developer tools info page (#4054)

* Translated developer tools info page

* Added set or remove as a variable in translation of key default_ui
This commit is contained in:
springstan 2019-10-19 17:59:57 +02:00 committed by Bram Kragten
parent bbc3e7d93f
commit 603240c467
3 changed files with 69 additions and 21 deletions

62
src/panels/developer-tools/info/developer-tools-info.ts Executable file → Normal file
View File

@ -31,12 +31,18 @@ class HaPanelDevInfo extends LitElement {
const nonDefaultLinkText = const nonDefaultLinkText =
localStorage.defaultPage === OPT_IN_PANEL && OPT_IN_PANEL === "states" localStorage.defaultPage === OPT_IN_PANEL && OPT_IN_PANEL === "states"
? "Go to the Lovelace UI" ? this.hass.localize("ui.panel.developer-tools.tabs.info.lovelace_ui")
: "Go to the states UI"; : this.hass.localize("ui.panel.developer-tools.tabs.info.states_ui");
const defaultPageText = `${ const defaultPageText = `${this.hass.localize(
localStorage.defaultPage === OPT_IN_PANEL ? "Remove" : "Set" "ui.panel.developer-tools.tabs.info.default_ui",
} ${OPT_IN_PANEL} as default page on this device`; "action",
localStorage.defaultPage === OPT_IN_PANEL
? this.hass.localize("ui.panel.developer-tools.tabs.info.remove")
: this.hass.localize("ui.panel.developer-tools.tabs.info.set"),
"name",
OPT_IN_PANEL
)}`;
return html` return html`
<div class="about"> <div class="about">
@ -45,42 +51,58 @@ class HaPanelDevInfo extends LitElement {
><img ><img
src="/static/icons/favicon-192x192.png" src="/static/icons/favicon-192x192.png"
height="192" height="192"
alt="Home Assistant logo" alt="${this.hass.localize(
"ui.panel.developer-tools.tabs.info.home_assistant_logo"
)}"
/></a> /></a>
<br /> <br />
<h2>Home Assistant ${hass.config.version}</h2> <h2>Home Assistant ${hass.config.version}</h2>
</p> </p>
<p> <p>
Path to configuration.yaml: ${hass.config.config_dir} ${this.hass.localize(
"ui.panel.developer-tools.tabs.info.path_configuration",
"path",
hass.config.config_dir
)}
</p> </p>
<p class="develop"> <p class="develop">
<a <a
href="https://www.home-assistant.io/developers/credits/" href="https://www.home-assistant.io/developers/credits/"
target="_blank" target="_blank"
> >
Developed by a bunch of awesome people. ${this.hass.localize(
"ui.panel.developer-tools.tabs.info.developed_by"
)}
</a> </a>
</p> </p>
<p> <p>
Published under the Apache 2.0 license<br /> ${this.hass.localize(
Source: "ui.panel.developer-tools.tabs.info.license"
)}<br />
${this.hass.localize("ui.panel.developer-tools.tabs.info.source")}
<a <a
href="https://github.com/home-assistant/home-assistant" href="https://github.com/home-assistant/home-assistant"
target="_blank" target="_blank"
>server</a >${this.hass.localize(
"ui.panel.developer-tools.tabs.info.server"
)}</a
> >
&mdash; &mdash;
<a <a
href="https://github.com/home-assistant/home-assistant-polymer" href="https://github.com/home-assistant/home-assistant-polymer"
target="_blank" target="_blank"
>frontend-ui</a >${this.hass.localize(
"ui.panel.developer-tools.tabs.info.frontend"
)}</a
> >
</p> </p>
<p> <p>
Built using ${this.hass.localize(
"ui.panel.developer-tools.tabs.info.built_using"
)}
<a href="https://www.python.org">Python 3</a>, <a href="https://www.python.org">Python 3</a>,
<a href="https://www.polymer-project.org" target="_blank">Polymer</a>, <a href="https://www.polymer-project.org" target="_blank">Polymer</a>,
Icons by ${this.hass.localize("ui.panel.developer-tools.tabs.info.icons_by")}
<a href="https://www.google.com/design/icons/" target="_blank" <a href="https://www.google.com/design/icons/" target="_blank"
>Google</a >Google</a
> >
@ -90,12 +112,20 @@ class HaPanelDevInfo extends LitElement {
>. >.
</p> </p>
<p> <p>
Frontend version: ${JS_VERSION} - ${JS_TYPE} ${this.hass.localize(
"ui.panel.developer-tools.tabs.info.frontend_version",
"version",
JS_VERSION,
"type",
JS_TYPE
)}
${ ${
customUiList.length > 0 customUiList.length > 0
? html` ? html`
<div> <div>
Custom UIs: ${this.hass.localize(
"ui.panel.developer-tools.tabs.info.custom_uis"
)}
${customUiList.map( ${customUiList.map(
(item) => html` (item) => html`
<div> <div>

View File

@ -32,7 +32,7 @@ const sortKeys = (a: string, b: string) => {
}; };
class SystemHealthCard extends LitElement { class SystemHealthCard extends LitElement {
@property() public hass?: HomeAssistant; @property() public hass!: HomeAssistant;
@property() private _info?: SystemHealthInfo; @property() private _info?: SystemHealthInfo;
protected render(): TemplateResult | void { protected render(): TemplateResult | void {
@ -78,7 +78,7 @@ class SystemHealthCard extends LitElement {
} }
return html` return html`
<ha-card header="System Health"> <ha-card header="${this.hass.localize("domain.system_health")}">
<div class="card-content">${sections}</div> <div class="card-content">${sections}</div>
</ha-card> </ha-card>
`; `;
@ -98,8 +98,9 @@ class SystemHealthCard extends LitElement {
} catch (err) { } catch (err) {
this._info = { this._info = {
system_health: { system_health: {
error: error: this.hass.localize(
"System Health component is not loaded. Add 'system_health:' to configuration.yaml", "ui.panel.developer-tools.tabs.info.system_health_error"
),
}, },
}; };
} }

View File

@ -1793,7 +1793,24 @@
"developer-tools": { "developer-tools": {
"tabs": { "tabs": {
"info": { "info": {
"title": "Info" "title": "Info",
"remove": "Remove",
"set": "Set",
"default_ui": "{action} {name} as default page on this device",
"lovelace_ui": "Go to the Lovelace UI",
"states_ui": "Go to the states UI",
"home_assistant_logo": "Home Assistant logo",
"path_configuration": "Path to configuration.yaml: {path}",
"developed_by": "Developed by a bunch of awesome people.",
"license": "Published under the Apache 2.0 license",
"source": "Source:",
"server": "server",
"frontend": "frontend-ui",
"built_using": "Built using",
"icons_by": "Icons by",
"frontend_version": "Frontend version: {version} - {type}",
"custom_uis": "Custom UIs:",
"system_health_error": "System Health component is not loaded. Add 'system_health:' to configuration.yaml"
}, },
"logs": { "logs": {
"title": "Logs", "title": "Logs",