mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +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() {
|
||||
return html`
|
||||
<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">
|
||||
<p class="description">
|
||||
Enter sentences and see how they will be parsed by Home Assistant.
|
||||
Each line will be processed as individual sentence. Intents will
|
||||
not be executed on your instance.
|
||||
${this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.assist.description"
|
||||
)}
|
||||
</p>
|
||||
${this.supportedLanguages
|
||||
? html`
|
||||
@ -132,7 +137,9 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
: nothing}
|
||||
<ha-textarea
|
||||
autogrow
|
||||
label="Sentences"
|
||||
.label=${this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.assist.sentences"
|
||||
)}
|
||||
id="sentences-input"
|
||||
@input=${this._textAreaInput}
|
||||
@keydown=${this._handleKeyDown}
|
||||
@ -143,7 +150,9 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
@click=${this._parse}
|
||||
.disabled=${!this._language || !this._validInput}
|
||||
>
|
||||
Parse sentences
|
||||
${this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.assist.parse_sentences"
|
||||
)}
|
||||
</ha-button>
|
||||
</div>
|
||||
</ha-card>
|
||||
@ -153,7 +162,9 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
<div class="result-toolbar">
|
||||
<ha-button outlined @click=${this._download}>
|
||||
<ha-svg-icon slot="icon" .path=${mdiDownload}></ha-svg-icon>
|
||||
Download Results
|
||||
${this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.assist.download_results"
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
`
|
||||
@ -170,7 +181,10 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
<p>${matched ? "✅" : "❌"}</p>
|
||||
</div>
|
||||
<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})
|
||||
</div>
|
||||
${result
|
||||
@ -184,7 +198,9 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
></ha-code-editor>
|
||||
`
|
||||
: html`<ha-alert alert-type="error">
|
||||
No intent matched
|
||||
${this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.assist.no_match"
|
||||
)}
|
||||
</ha-alert>`}
|
||||
</div>
|
||||
</ha-card>
|
||||
|
@ -5430,6 +5430,15 @@
|
||||
},
|
||||
"developer-tools": {
|
||||
"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": {
|
||||
"title": "Events",
|
||||
"description": "Fire an event on the event bus.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user