Fix matter translations (#28752)

This commit is contained in:
Simon Lamon 2026-01-02 11:22:45 +01:00 committed by Bram Kragten
parent c1d135aa16
commit 13505a9104
2 changed files with 104 additions and 27 deletions

View File

@ -46,44 +46,54 @@ export class MatterConfigDashboard extends LitElement {
href="/config/thread"
slot="toolbar-icon"
>
Visit Thread Panel</ha-button
${this.hass.localize(
"ui.panel.config.matter.panel.thread_panel"
)}</ha-button
>
`
: ""}
<div class="content">
<ha-card header="Matter">
<ha-alert alert-type="warning"
>Matter is still in the early phase of development, it is not
meant to be used in production. This panel is for development
only.</ha-alert
>${this.hass.localize(
"ui.panel.config.matter.panel.experimental_note"
)}</ha-alert
>
<div class="card-content">
${this._error
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
: ""}
You can add Matter devices by commissing them if they are not
setup yet, or share them from another controller and enter the
share code.
${this.hass.localize("ui.panel.config.matter.panel.add_devices")}
</div>
<div class="card-actions">
${canCommissionMatterExternal(this.hass)
? html`<ha-button
appearance="plain"
@click=${this._startMobileCommissioning}
>Commission device with mobile app</ha-button
>${this.hass.localize(
"ui.panel.config.matter.panel.mobile_app_commisioning"
)}</ha-button
>`
: ""}
<ha-button appearance="plain" @click=${this._commission}
>Commission device</ha-button
>${this.hass.localize(
"ui.panel.config.matter.panel.commission_device"
)}</ha-button
>
<ha-button appearance="plain" @click=${this._acceptSharedDevice}
>Add shared device</ha-button
>${this.hass.localize(
"ui.panel.config.matter.panel.add_shared_device"
)}</ha-button
>
<ha-button appearance="plain" @click=${this._setWifi}
>Set WiFi Credentials</ha-button
>${this.hass.localize(
"ui.panel.config.matter.panel.set_wifi_credentials"
)}</ha-button
>
<ha-button appearance="plain" @click=${this._setThread}
>Set Thread Credentials</ha-button
>${this.hass.localize(
"ui.panel.config.matter.panel.set_thread_credentials"
)}</ha-button
>
</div>
</ha-card>
@ -114,19 +124,31 @@ export class MatterConfigDashboard extends LitElement {
private async _setWifi(): Promise<void> {
this._error = undefined;
const networkName = await showPromptDialog(this, {
title: "Network name",
inputLabel: "Network name",
title: this.hass.localize(
"ui.panel.config.matter.panel.prompts.network_name.title"
),
inputLabel: this.hass.localize(
"ui.panel.config.matter.panel.prompts.network_name.input_label"
),
inputType: "string",
confirmText: "Continue",
confirmText: this.hass.localize(
"ui.panel.config.matter.panel.prompts.network_name.confirm"
),
});
if (!networkName) {
return;
}
const psk = await showPromptDialog(this, {
title: "Passcode",
inputLabel: "Code",
title: this.hass.localize(
"ui.panel.config.matter.panel.prompts.passcode.title"
),
inputLabel: this.hass.localize(
"ui.panel.config.matter.panel.prompts.passcode.input_label"
),
inputType: "password",
confirmText: "Set Wifi",
confirmText: this.hass.localize(
"ui.panel.config.matter.panel.prompts.passcode.confirm"
),
});
if (!psk) {
return;
@ -140,10 +162,16 @@ export class MatterConfigDashboard extends LitElement {
private async _commission(): Promise<void> {
const code = await showPromptDialog(this, {
title: "Commission device",
inputLabel: "Code",
title: this.hass.localize(
"ui.panel.config.matter.panel.prompts.commission_device.title"
),
inputLabel: this.hass.localize(
"ui.panel.config.matter.panel.prompts.commission_device.input_label"
),
inputType: "string",
confirmText: "Commission",
confirmText: this.hass.localize(
"ui.panel.config.matter.panel.prompts.commission_device.confirm"
),
});
if (!code) {
return;
@ -160,10 +188,16 @@ export class MatterConfigDashboard extends LitElement {
private async _acceptSharedDevice(): Promise<void> {
const code = await showPromptDialog(this, {
title: "Add shared device",
inputLabel: "Pin",
title: this.hass.localize(
"ui.panel.config.matter.panel.prompts.add_shared_device.title"
),
inputLabel: this.hass.localize(
"ui.panel.config.matter.panel.prompts.add_shared_device.input_label"
),
inputType: "number",
confirmText: "Accept device",
confirmText: this.hass.localize(
"ui.panel.config.matter.panel.prompts.add_shared_device.confirm"
),
});
if (!code) {
return;
@ -180,10 +214,16 @@ export class MatterConfigDashboard extends LitElement {
private async _setThread(): Promise<void> {
const code = await showPromptDialog(this, {
title: "Set Thread operation",
inputLabel: "Dataset",
title: this.hass.localize(
"ui.panel.config.matter.panel.prompts.set_thread.title"
),
inputLabel: this.hass.localize(
"ui.panel.config.matter.panel.prompts.set_thread.input_label"
),
inputType: "string",
confirmText: "Set Thread",
confirmText: this.hass.localize(
"ui.panel.config.matter.panel.prompts.set_thread.confirm"
),
});
if (!code) {
return;

View File

@ -6834,6 +6834,43 @@
}
},
"matter": {
"panel": {
"thread_panel": "Visit Thread Panel",
"experimental_note": "Matter is still in the early phase of development, it is not meant to be used in production. This panel is for development only.",
"add_devices": "You can add Matter devices by commissioning them if they are not set up yet, or share them from another controller and enter the sharing code.",
"mobile_app_commisioning": "Commission device with mobile app",
"commission_device": "Commission device",
"add_shared_device": "Add shared device",
"set_wifi_credentials": "Set Wi-Fi Credentials",
"set_thread_credentials": "Set Thread credentials",
"prompts": {
"network_name": {
"title": "Network name",
"input_label": "Network name",
"confirm": "Continue"
},
"passcode": {
"title": "Passcode",
"input_label": "Code",
"confirm": "Set Wifi"
},
"commission_device": {
"title": "Commission device",
"input_label": "Code",
"confirm": "Commission"
},
"add_shared_device": {
"title": "Add shared device",
"input_label": "Pin",
"confirm": "Accept device"
},
"set_thread": {
"title": "Set Thread operation",
"input_label": "Dataset",
"confirm": "Set Thread"
}
}
},
"network_type": {
"thread": "Thread",
"wifi": "Wi-Fi",