From 44e6b58d8c674618a85cf7d5962d32ef4011ac5d Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Tue, 7 Jan 2025 18:24:50 +0100 Subject: [PATCH] Add data picker translations --- .../components/ha-backup-data-picker.ts | 25 +++++++++++++++---- src/translations/en.json | 8 ++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/panels/config/backup/components/ha-backup-data-picker.ts b/src/panels/config/backup/components/ha-backup-data-picker.ts index fbb944322b09..4b5cfa86df00 100644 --- a/src/panels/config/backup/components/ha-backup-data-picker.ts +++ b/src/panels/config/backup/components/ha-backup-data-picker.ts @@ -77,7 +77,11 @@ export class HaBackupDataPicker extends LitElement { if (data.homeassistant_included) { items.push({ - label: `Settings${data.database_included ? " and history" : ""}`, + label: data.database_included + ? this.hass.localize( + "ui.panel.config.backup.data_picker.settings_and_history" + ) + : this.hass.localize("ui.panel.config.backup.data_picker.settings"), id: "config", version: data.homeassistant_version, }); @@ -93,8 +97,17 @@ export class HaBackupDataPicker extends LitElement { ); private _localizeFolder(folder: string): string { - if (folder === "addons/local") { - return "Local addons"; + switch (folder) { + case "media": + return this.hass.localize("ui.panel.config.backup.data_picker.media"); + case "share": + return this.hass.localize( + "ui.panel.config.backup.data_picker.share_folder" + ); + case "addons/local": + return this.hass.localize( + "ui.panel.config.backup.data_picker.local_addons" + ); } return capitalizeFirstLetter(folder); } @@ -219,7 +232,7 @@ export class HaBackupDataPicker extends LitElement { @@ -265,7 +278,9 @@ export class HaBackupDataPicker extends LitElement { diff --git a/src/translations/en.json b/src/translations/en.json index df8d0f1bf01d..7533ae0ae336 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2267,6 +2267,14 @@ "addons_none": "None", "addons_custom": "Custom" }, + "data_picker": { + "settings": "Settings", + "settings_and_history": "Settings and history", + "media": "Media", + "share_folder": "Share folder", + "local_addons": "Local addons folder", + "addons": "Add-ons" + }, "schedule": { "use_automatic_backups": "Use automatic backups", "schedule": "Schedule",