Remove analytics translations (#9002)

This commit is contained in:
Joakim Sørensen 2021-04-27 22:44:28 +02:00 committed by GitHub
parent 83e65e2cc6
commit 93a1adaa56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 95 deletions

View File

@ -6,5 +6,6 @@ export const analyticsLearnMore = (hass: HomeAssistant) => html`<a
.href=${documentationUrl(hass, "/integrations/analytics/")} .href=${documentationUrl(hass, "/integrations/analytics/")}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
>${hass.localize("ui.panel.config.core.section.core.analytics.learn_more")}</a >
>`; How we process your data
</a>`;

View File

@ -8,7 +8,6 @@ import {
property, property,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { isComponentLoaded } from "../common/config/is_component_loaded";
import { fireEvent } from "../common/dom/fire_event"; import { fireEvent } from "../common/dom/fire_event";
import { Analytics, AnalyticsPreferences } from "../data/analytics"; import { Analytics, AnalyticsPreferences } from "../data/analytics";
import { haStyle } from "../resources/styles"; import { haStyle } from "../resources/styles";
@ -17,7 +16,18 @@ import "./ha-checkbox";
import type { HaCheckbox } from "./ha-checkbox"; import type { HaCheckbox } from "./ha-checkbox";
import "./ha-settings-row"; import "./ha-settings-row";
const ADDITIONAL_PREFERENCES = ["usage", "statistics"]; const ADDITIONAL_PREFERENCES = [
{
key: "usage",
title: "Usage",
description: "Details of what you use with Home Assistant",
},
{
key: "statistics",
title: "Statistical data",
description: "Counts containing total number of datapoints",
},
];
declare global { declare global {
interface HASSDomEvents { interface HASSDomEvents {
@ -48,14 +58,10 @@ export class HaAnalytics extends LitElement {
</ha-checkbox> </ha-checkbox>
</span> </span>
<span slot="heading" data-for="base"> <span slot="heading" data-for="base">
${this.hass.localize( Basic analytics
`ui.panel.config.core.section.core.analytics.preference.base.title`
)}
</span> </span>
<span slot="description" data-for="base"> <span slot="description" data-for="base">
${this.hass.localize( This includes information about your system.
`ui.panel.config.core.section.core.analytics.preference.base.description`
)}
</span> </span>
</ha-settings-row> </ha-settings-row>
${ADDITIONAL_PREFERENCES.map( ${ADDITIONAL_PREFERENCES.map(
@ -64,44 +70,23 @@ export class HaAnalytics extends LitElement {
<span slot="prefix"> <span slot="prefix">
<ha-checkbox <ha-checkbox
@change=${this._handleRowCheckboxClick} @change=${this._handleRowCheckboxClick}
.checked=${this.analytics?.preferences[preference]} .checked=${this.analytics?.preferences[preference.key]}
.preference=${preference} .preference=${preference.key}
name=${preference} name=${preference.key}
> >
</ha-checkbox> </ha-checkbox>
${!baseEnabled ${!baseEnabled
? html`<paper-tooltip animation-delay="0" position="right" ? html`<paper-tooltip animation-delay="0" position="right">
>${this.hass.localize( You need to enable basic analytics for this option to be
"ui.panel.config.core.section.core.analytics.needs_base" available
)}
</paper-tooltip>` </paper-tooltip>`
: ""} : ""}
</span> </span>
<span slot="heading" data-for=${preference}> <span slot="heading" data-for=${preference.key}>
${preference === "usage" ${preference.title}
? isComponentLoaded(this.hass, "hassio")
? this.hass.localize(
`ui.panel.config.core.section.core.analytics.preference.usage_supervisor.title`
)
: this.hass.localize(
`ui.panel.config.core.section.core.analytics.preference.usage.title`
)
: this.hass.localize(
`ui.panel.config.core.section.core.analytics.preference.${preference}.title`
)}
</span> </span>
<span slot="description" data-for=${preference}> <span slot="description" data-for=${preference.key}>
${preference !== "usage" ${preference.description}
? this.hass.localize(
`ui.panel.config.core.section.core.analytics.preference.${preference}.description`
)
: isComponentLoaded(this.hass, "hassio")
? this.hass.localize(
`ui.panel.config.core.section.core.analytics.preference.usage_supervisor.description`
)
: this.hass.localize(
`ui.panel.config.core.section.core.analytics.preference.usage.description`
)}
</span> </span>
</ha-settings-row>` </ha-settings-row>`
)} )}
@ -117,14 +102,10 @@ export class HaAnalytics extends LitElement {
</ha-checkbox> </ha-checkbox>
</span> </span>
<span slot="heading" data-for="diagnostics"> <span slot="heading" data-for="diagnostics">
${this.hass.localize( Diagnostics
`ui.panel.config.core.section.core.analytics.preference.diagnostics.title`
)}
</span> </span>
<span slot="description" data-for="diagnostics"> <span slot="description" data-for="diagnostics">
${this.hass.localize( Share crash reports when unexpected errors occur.
`ui.panel.config.core.section.core.analytics.preference.diagnostics.description`
)}
</span> </span>
</ha-settings-row> </ha-settings-row>
`; `;
@ -161,7 +142,10 @@ export class HaAnalytics extends LitElement {
preferences[preference] = checkbox.checked; preferences[preference] = checkbox.checked;
if (ADDITIONAL_PREFERENCES.includes(preference) && checkbox.checked) { if (
ADDITIONAL_PREFERENCES.some((entry) => entry.key === preference) &&
checkbox.checked
) {
preferences.base = true; preferences.base = true;
} else if (preference === "base" && !checkbox.checked) { } else if (preference === "base" && !checkbox.checked) {
preferences.usage = false; preferences.usage = false;

View File

@ -32,13 +32,9 @@ class OnboardingAnalytics extends LitElement {
protected render(): TemplateResult { protected render(): TemplateResult {
return html` return html`
<p> <p>
${this.hass.localize( Share anonymized information from your installation to help make Home
"ui.panel.config.core.section.core.analytics.introduction", Assistant better and help us convince manufacturers to add local control
"link", and privacy-focused features.
html`<a href="https://analytics.home-assistant.io" target="_blank"
>analytics.home-assistant.io</a
>`
)}
</p> </p>
<ha-analytics <ha-analytics
@analytics-preferences-changed=${this._preferencesChanged} @analytics-preferences-changed=${this._preferencesChanged}

View File

@ -40,21 +40,13 @@ class ConfigAnalytics extends LitElement {
: undefined; : undefined;
return html` return html`
<ha-card <ha-card header="Analytics">
.header=${this.hass.localize(
"ui.panel.config.core.section.core.analytics.header"
)}
>
<div class="card-content"> <div class="card-content">
${error ? html`<div class="error">${error}</div>` : ""} ${error ? html`<div class="error">${error}</div>` : ""}
<p> <p>
${this.hass.localize( Share anonymized information from your installation to help make
"ui.panel.config.core.section.core.analytics.introduction", Home Assistant better and help us convince manufacturers to add
"link", local control and privacy-focused features.
html`<a href="https://analytics.home-assistant.io" target="_blank"
>analytics.home-assistant.io</a
>`
)}
</p> </p>
<ha-analytics <ha-analytics
@analytics-preferences-changed=${this._preferencesChanged} @analytics-preferences-changed=${this._preferencesChanged}

View File

@ -997,34 +997,6 @@
"save_button": "Save", "save_button": "Save",
"external_url": "External URL", "external_url": "External URL",
"internal_url": "Internal URL" "internal_url": "Internal URL"
},
"analytics": {
"header": "Analytics",
"introduction": "Share your installation information to help make Home Assistant better and help us convince manufacturers to add local control and privacy-focused features.",
"needs_base": "You need to enable base analytics for this option to be available",
"preference": {
"base": {
"title": "Basic analytics",
"description": "Instance ID, version and installation type."
},
"diagnostics": {
"title": "Diagnostics",
"description": "Share crash reports when unexpected errors occur."
},
"usage": {
"title": "Used Integrations",
"description": "Names and version information."
},
"usage_supervisor": {
"title": "Used integrations and add-ons",
"description": "Names, versions and capabilities."
},
"statistics": {
"title": "Usage statistics",
"description": "Total used entities, users and other elements."
}
},
"learn_more": "How we process your data"
} }
} }
} }