Skip to content

Commit

Permalink
Add translations
Browse files Browse the repository at this point in the history
  • Loading branch information
wendevlin committed Dec 20, 2024
1 parent b35f994 commit 8de7c80
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class HaBackupConfigAgents extends LitElement {

private _description(agentId: string) {
if (agentId === CLOUD_AGENT) {
return "It stores one backup. The oldest backups are deleted.";
return this.hass.localize(
"ui.panel.config.backup.agents.cloud_agent_description"
);
}
return "";
}
Expand Down Expand Up @@ -104,7 +106,9 @@ class HaBackupConfigAgents extends LitElement {
})}
</ha-md-list>
`
: html`<p>No sync agents configured</p>`}
: html`<p>
${this.hass.localize("ui.panel.config.backup.agents.no_agents")}
</p>`}
`;
}

Expand Down
77 changes: 60 additions & 17 deletions src/panels/config/backup/components/config/ha-backup-config-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,15 @@ class HaBackupConfigData extends LitElement {
<ha-svg-icon slot="start" .path=${mdiCog}></ha-svg-icon>
<span slot="headline">
${this.forceHomeAssistant
? "Home Assistant settings are always included"
: "Home Assistant settings"}
? this.hass.localize(
"ui.panel.config.backup.data.ha_settings_included"
)
: this.hass.localize("ui.panel.config.backup.data.ha_settings")}
</span>
<span slot="supporting-text">
The bare minimum needed to restore your system.
${this.hass.localize(
"ui.panel.config.backup.data.ha_settings_description"
)}
</span>
${this.forceHomeAssistant
? nothing
Expand All @@ -172,9 +176,13 @@ class HaBackupConfigData extends LitElement {
<ha-md-list-item>
<ha-svg-icon slot="start" .path=${mdiChartBox}></ha-svg-icon>
<span slot="headline">History</span>
<span slot="headline"
>${this.hass.localize("ui.panel.config.backup.data.history")}</span
>
<span slot="supporting-text">
Historical data of your sensors, including your energy dashboard.
${this.hass.localize(
"ui.panel.config.backup.data.history_description"
)}
</span>
<ha-switch
id="database"
Expand All @@ -191,9 +199,15 @@ class HaBackupConfigData extends LitElement {
slot="start"
.path=${mdiPlayBoxMultiple}
></ha-svg-icon>
<span slot="headline">Media</span>
<span slot="headline"
>${this.hass.localize(
"ui.panel.config.backup.data.media"
)}</span
>
<span slot="supporting-text">
For example, camera recordings.
${this.hass.localize(
"ui.panel.config.backup.data.history_description"
)}
</span>
<ha-switch
id="media"
Expand All @@ -205,10 +219,15 @@ class HaBackupConfigData extends LitElement {
<ha-md-list-item>
<ha-svg-icon slot="start" .path=${mdiFolder}></ha-svg-icon>
<span slot="headline">Share folder</span>
<span slot="headline"
>${this.hass.localize(
"ui.panel.config.backup.data.share_folder"
)}</span
>
<span slot="supporting-text">
Folder that is often used for advanced or older
configurations.
${this.hass.localize(
"ui.panel.config.backup.data.share_folder_description"
)}
</span>
<ha-switch
id="share"
Expand All @@ -225,9 +244,15 @@ class HaBackupConfigData extends LitElement {
slot="start"
.path=${mdiFolder}
></ha-svg-icon>
<span slot="headline">Local addons folder</span>
<span slot="headline"
>${this.hass.localize(
"ui.panel.config.backup.data.local_addons"
)}</span
>
<span slot="supporting-text">
Folder that contains the data of your local add-ons.
${this.hass.localize(
"ui.panel.config.backup.data.local_addons_description"
)}
</span>
<ha-switch
id="local_addons"
Expand All @@ -245,9 +270,15 @@ class HaBackupConfigData extends LitElement {
slot="start"
.path=${mdiPuzzle}
></ha-svg-icon>
<span slot="headline">Add-ons</span>
<span slot="headline"
>${this.hass.localize(
"ui.panel.config.backup.data.addons"
)}</span
>
<span slot="supporting-text">
Select what add-ons you want to include.
${this.hass.localize(
"ui.panel.config.backup.data.addons_description"
)}
</span>
<ha-md-select
slot="end"
Expand All @@ -256,13 +287,25 @@ class HaBackupConfigData extends LitElement {
.value=${data.addons_mode}
>
<ha-md-select-option value="all">
<div slot="headline">All</div>
<div slot="headline">
${this.hass.localize(
"ui.panel.config.backup.data.addons_all"
)}
</div>
</ha-md-select-option>
<ha-md-select-option value="none">
<div slot="headline">None</div>
<div slot="headline">
${this.hass.localize(
"ui.panel.config.backup.data.addons_none"
)}
</div>
</ha-md-select-option>
<ha-md-select-option value="custom">
<div slot="headline">Custom</div>
<div slot="headline">
${this.hass.localize(
"ui.panel.config.backup.data.addons_custom"
)}
</div>
</ha-md-select-option>
</ha-md-select>
</ha-md-list-item>
Expand Down
22 changes: 22 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2220,6 +2220,28 @@
}
}
}
},
"agents": {
"cloud_agent_description": "It stores one backup. The oldest backups are deleted.",
"no_agents": "No sync agents configured"
},
"data": {
"ha_settings_included": "Home Assistant settings are always included",
"ha_settings": "Home Assistant settings",
"ha_settings_description": "The bare minimum needed to restore your system.",
"history": "History",
"history_description": "Historical data of your sensors, including your energy dashboard.",
"media": "Media",
"media_description": "For example, camera recordings.",
"share_folder": "Share folder",
"share_folder_description": "Folder that is often used for advanced or older configurations.",
"local_addons": "Local addons folder",
"local_addons_description": "Folder that contains the data of your local add-ons.",
"addons": "Add-ons",
"addons_description": "Select what add-ons you want to include.",
"addons_all": "All",
"addons_none": "None",
"addons_custom": "Custom"
}
},
"tag": {
Expand Down

0 comments on commit 8de7c80

Please sign in to comment.