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() {
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>

View File

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