mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Localize developer-tools/assist (#17489)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
7a446ba2ad
commit
85733655c2
@ -113,12 +113,17 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
protected render() {
|
protected render() {
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<ha-card header="Sentences parser" class="form">
|
<ha-card
|
||||||
|
.header=${this.hass.localize(
|
||||||
|
"ui.panel.developer-tools.tabs.assist.title"
|
||||||
|
)}
|
||||||
|
class="form"
|
||||||
|
>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<p class="description">
|
<p class="description">
|
||||||
Enter sentences and see how they will be parsed by Home Assistant.
|
${this.hass.localize(
|
||||||
Each line will be processed as individual sentence. Intents will
|
"ui.panel.developer-tools.tabs.assist.description"
|
||||||
not be executed on your instance.
|
)}
|
||||||
</p>
|
</p>
|
||||||
${this.supportedLanguages
|
${this.supportedLanguages
|
||||||
? html`
|
? html`
|
||||||
@ -132,7 +137,9 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
: nothing}
|
: nothing}
|
||||||
<ha-textarea
|
<ha-textarea
|
||||||
autogrow
|
autogrow
|
||||||
label="Sentences"
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.developer-tools.tabs.assist.sentences"
|
||||||
|
)}
|
||||||
id="sentences-input"
|
id="sentences-input"
|
||||||
@input=${this._textAreaInput}
|
@input=${this._textAreaInput}
|
||||||
@keydown=${this._handleKeyDown}
|
@keydown=${this._handleKeyDown}
|
||||||
@ -143,7 +150,9 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
@click=${this._parse}
|
@click=${this._parse}
|
||||||
.disabled=${!this._language || !this._validInput}
|
.disabled=${!this._language || !this._validInput}
|
||||||
>
|
>
|
||||||
Parse sentences
|
${this.hass.localize(
|
||||||
|
"ui.panel.developer-tools.tabs.assist.parse_sentences"
|
||||||
|
)}
|
||||||
</ha-button>
|
</ha-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
@ -153,7 +162,9 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
<div class="result-toolbar">
|
<div class="result-toolbar">
|
||||||
<ha-button outlined @click=${this._download}>
|
<ha-button outlined @click=${this._download}>
|
||||||
<ha-svg-icon slot="icon" .path=${mdiDownload}></ha-svg-icon>
|
<ha-svg-icon slot="icon" .path=${mdiDownload}></ha-svg-icon>
|
||||||
Download Results
|
${this.hass.localize(
|
||||||
|
"ui.panel.developer-tools.tabs.assist.download_results"
|
||||||
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
@ -170,7 +181,10 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
<p>${matched ? "✅" : "❌"}</p>
|
<p>${matched ? "✅" : "❌"}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
Language: ${formatLanguageCode(language, this.hass.locale)}
|
${this.hass.localize(
|
||||||
|
"ui.panel.developer-tools.tabs.assist.language"
|
||||||
|
)}:
|
||||||
|
${formatLanguageCode(language, this.hass.locale)}
|
||||||
(${language})
|
(${language})
|
||||||
</div>
|
</div>
|
||||||
${result
|
${result
|
||||||
@ -184,7 +198,9 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
></ha-code-editor>
|
></ha-code-editor>
|
||||||
`
|
`
|
||||||
: html`<ha-alert alert-type="error">
|
: html`<ha-alert alert-type="error">
|
||||||
No intent matched
|
${this.hass.localize(
|
||||||
|
"ui.panel.developer-tools.tabs.assist.no_match"
|
||||||
|
)}
|
||||||
</ha-alert>`}
|
</ha-alert>`}
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
|
@ -5430,6 +5430,15 @@
|
|||||||
},
|
},
|
||||||
"developer-tools": {
|
"developer-tools": {
|
||||||
"tabs": {
|
"tabs": {
|
||||||
|
"assist": {
|
||||||
|
"title": "Sentences parser",
|
||||||
|
"description": "Enter sentences and see how they will be parsed by Home Assistant. Each line will be processed as an individual sentence. Intents will not be executed on your instance.",
|
||||||
|
"parse_sentences": "Parse sentences",
|
||||||
|
"sentences": "Sentences",
|
||||||
|
"download_results": "Download results",
|
||||||
|
"no_match": "No intent matched",
|
||||||
|
"language": "[%key:ui::components::language-picker::language%]"
|
||||||
|
},
|
||||||
"events": {
|
"events": {
|
||||||
"title": "Events",
|
"title": "Events",
|
||||||
"description": "Fire an event on the event bus.",
|
"description": "Fire an event on the event bus.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user