Fix backup data picker translations (#23826)

This commit is contained in:
Paul Bottein 2025-01-21 13:17:33 +01:00 committed by GitHub
parent 7535d66373
commit 87907b98bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 8 deletions

View File

@ -4,6 +4,7 @@ import {
mdiFolder,
mdiPlayBoxMultiple,
mdiPuzzle,
mdiShieldCheck,
} from "@mdi/js";
import type { PropertyValues } from "lit";
import { css, html, LitElement, nothing } from "lit";
@ -36,6 +37,7 @@ const ITEM_ICONS = {
database: mdiChartBox,
media: mdiPlayBoxMultiple,
share: mdiFolder,
ssl: mdiShieldCheck,
};
interface SelectedItems {
@ -104,6 +106,8 @@ export class HaBackupDataPicker extends LitElement {
return this.hass.localize(
"ui.panel.config.backup.data_picker.share_folder"
);
case "ssl":
return this.hass.localize("ui.panel.config.backup.data_picker.ssl");
case "addons/local":
return this.hass.localize(
"ui.panel.config.backup.data_picker.local_addons"
@ -167,15 +171,14 @@ export class HaBackupDataPicker extends LitElement {
})
);
private _itemChanged(ev: Event) {
private _homeassistantChanged(ev: Event) {
const itemValues = this._parseValue(this.value);
const checkbox = ev.currentTarget as HaCheckbox;
const section = (checkbox as any).section;
if (checkbox.checked) {
itemValues[section].push(checkbox.id);
itemValues.homeassistant.push(checkbox.id);
} else {
itemValues[section] = itemValues[section].filter(
itemValues.homeassistant = itemValues.homeassistant.filter(
(id) => id !== checkbox.id
);
}
@ -262,8 +265,7 @@ export class HaBackupDataPicker extends LitElement {
.checked=${selectedItems.homeassistant.includes(
item.id
)}
.section=${"homeassistant"}
@change=${this._itemChanged}
@change=${this._homeassistantChanged}
></ha-checkbox>
</ha-formfield>
`
@ -279,7 +281,7 @@ export class HaBackupDataPicker extends LitElement {
<ha-backup-formfield-label
slot="label"
.label=${this.hass.localize(
"ui.panel.config.backup.data_picker.local_addons"
"ui.panel.config.backup.data_picker.addons"
)}
.iconPath=${mdiPuzzle}
>

View File

@ -2408,7 +2408,8 @@
"media": "Media",
"share_folder": "Share folder",
"local_addons": "Local add-ons folder",
"addons": "Add-ons"
"addons": "Add-ons",
"ssl": "SSL certificates"
},
"schedule": {
"schedule": "Schedule",