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:
karwosts 2023-08-08 03:11:02 -07:00 committed by GitHub
parent 7a446ba2ad
commit 85733655c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 9 deletions

View File

@ -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>

View File

@ -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.",