Skip to content

Commit

Permalink
Add data picker translations
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Jan 7, 2025
1 parent b489ea5 commit 44e6b58
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/panels/config/backup/components/ha-backup-data-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand All @@ -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);
}
Expand Down Expand Up @@ -219,7 +232,7 @@ export class HaBackupDataPicker extends LitElement {
<ha-formfield>
<ha-backup-formfield-label
slot="label"
.label=${"Home Assistant"}
label="Home Assistant"
.iconPath=${mdiHomeAssistant}
>
</ha-backup-formfield-label>
Expand Down Expand Up @@ -265,7 +278,9 @@ export class HaBackupDataPicker extends LitElement {
<ha-formfield>
<ha-backup-formfield-label
slot="label"
.label=${"Add-ons"}
.label=${this.hass.localize(
"ui.panel.config.backup.data_picker.local_addons"
)}
.iconPath=${mdiPuzzle}
>
</ha-backup-formfield-label>
Expand Down
8 changes: 8 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 44e6b58

Please sign in to comment.