mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 01:06:35 +00:00
Improve default theme wording (#17336)
* Improve default theme wording * Remove home assistant translation
This commit is contained in:
parent
000288aecb
commit
4a044fc40e
@ -42,17 +42,15 @@ export class HaThemePicker extends LitElement {
|
|||||||
fixedMenuPosition
|
fixedMenuPosition
|
||||||
naturalMenuWidth
|
naturalMenuWidth
|
||||||
>
|
>
|
||||||
<mwc-list-item value="remove"
|
<mwc-list-item value="remove">
|
||||||
>${this.hass!.localize(
|
${this.hass!.localize("ui.components.theme-picker.no_theme")}
|
||||||
"ui.components.theme-picker.no_theme"
|
</mwc-list-item>
|
||||||
)}</mwc-list-item
|
|
||||||
>
|
|
||||||
${this.includeDefault
|
${this.includeDefault
|
||||||
? html`<mwc-list-item .value=${DEFAULT_THEME}
|
? html`
|
||||||
>${this.hass!.localize(
|
<mwc-list-item .value=${DEFAULT_THEME}>
|
||||||
"ui.components.theme-picker.default"
|
Home Assistant
|
||||||
)}</mwc-list-item
|
</mwc-list-item>
|
||||||
>`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
${Object.keys(this.hass!.themes.themes)
|
${Object.keys(this.hass!.themes.themes)
|
||||||
.sort()
|
.sort()
|
||||||
|
@ -23,8 +23,8 @@ import {
|
|||||||
import { HomeAssistant } from "../../types";
|
import { HomeAssistant } from "../../types";
|
||||||
import { documentationUrl } from "../../util/documentation-url";
|
import { documentationUrl } from "../../util/documentation-url";
|
||||||
|
|
||||||
const BACKEND_SELECTED_THEME = "Backend-selected";
|
const USE_DEFAULT_THEME = "__USE_DEFAULT_THEME__";
|
||||||
const DEFAULT_THEME = "default";
|
const HOME_ASSISTANT_THEME = "default";
|
||||||
|
|
||||||
@customElement("ha-pick-theme-row")
|
@customElement("ha-pick-theme-row")
|
||||||
export class HaPickThemeRow extends LitElement {
|
export class HaPickThemeRow extends LitElement {
|
||||||
@ -68,15 +68,15 @@ export class HaPickThemeRow extends LitElement {
|
|||||||
<ha-select
|
<ha-select
|
||||||
.label=${this.hass.localize("ui.panel.profile.themes.dropdown_label")}
|
.label=${this.hass.localize("ui.panel.profile.themes.dropdown_label")}
|
||||||
.disabled=${!hasThemes}
|
.disabled=${!hasThemes}
|
||||||
.value=${this.hass.selectedTheme?.theme || BACKEND_SELECTED_THEME}
|
.value=${this.hass.selectedTheme?.theme || USE_DEFAULT_THEME}
|
||||||
@selected=${this._handleThemeSelection}
|
@selected=${this._handleThemeSelection}
|
||||||
naturalMenuWidth
|
naturalMenuWidth
|
||||||
>
|
>
|
||||||
<mwc-list-item .value=${BACKEND_SELECTED_THEME}>
|
<mwc-list-item .value=${USE_DEFAULT_THEME}>
|
||||||
${this.hass.localize("ui.panel.profile.themes.backend-selected")}
|
${this.hass.localize("ui.panel.profile.themes.use_default")}
|
||||||
</mwc-list-item>
|
</mwc-list-item>
|
||||||
<mwc-list-item .value=${DEFAULT_THEME}>
|
<mwc-list-item .value=${HOME_ASSISTANT_THEME}>
|
||||||
${this.hass.localize("ui.panel.profile.themes.default")}
|
Home Assistant
|
||||||
</mwc-list-item>
|
</mwc-list-item>
|
||||||
${this._themeNames.map(
|
${this._themeNames.map(
|
||||||
(theme) => html`
|
(theme) => html`
|
||||||
@ -85,7 +85,8 @@ export class HaPickThemeRow extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</ha-select>
|
</ha-select>
|
||||||
</ha-settings-row>
|
</ha-settings-row>
|
||||||
${curTheme === DEFAULT_THEME || this._supportsModeSelection(curTheme)
|
${curTheme === HOME_ASSISTANT_THEME ||
|
||||||
|
this._supportsModeSelection(curTheme)
|
||||||
? html` <div class="inputs">
|
? html` <div class="inputs">
|
||||||
<ha-formfield
|
<ha-formfield
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
@ -125,7 +126,7 @@ export class HaPickThemeRow extends LitElement {
|
|||||||
>
|
>
|
||||||
</ha-radio>
|
</ha-radio>
|
||||||
</ha-formfield>
|
</ha-formfield>
|
||||||
${curTheme === DEFAULT_THEME
|
${curTheme === HOME_ASSISTANT_THEME
|
||||||
? html`<div class="color-pickers">
|
? html`<div class="color-pickers">
|
||||||
<ha-textfield
|
<ha-textfield
|
||||||
.value=${themeSettings?.primaryColor ||
|
.value=${themeSettings?.primaryColor ||
|
||||||
@ -207,7 +208,7 @@ export class HaPickThemeRow extends LitElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theme === BACKEND_SELECTED_THEME) {
|
if (theme === USE_DEFAULT_THEME) {
|
||||||
if (this.hass.selectedTheme?.theme) {
|
if (this.hass.selectedTheme?.theme) {
|
||||||
fireEvent(this, "settheme", {
|
fireEvent(this, "settheme", {
|
||||||
theme: "",
|
theme: "",
|
||||||
|
@ -403,8 +403,7 @@
|
|||||||
},
|
},
|
||||||
"theme-picker": {
|
"theme-picker": {
|
||||||
"theme": "Theme",
|
"theme": "Theme",
|
||||||
"no_theme": "No theme",
|
"no_theme": "No theme"
|
||||||
"default": "[%key:ui::panel::profile::themes::default%]"
|
|
||||||
},
|
},
|
||||||
"language-picker": {
|
"language-picker": {
|
||||||
"language": "Language",
|
"language": "Language",
|
||||||
@ -5194,8 +5193,7 @@
|
|||||||
"primary_color": "Primary color",
|
"primary_color": "Primary color",
|
||||||
"accent_color": "Accent color",
|
"accent_color": "Accent color",
|
||||||
"reset": "Reset",
|
"reset": "Reset",
|
||||||
"backend-selected": "Use backend preferred theme",
|
"use_default": "Use default theme"
|
||||||
"default": "Default"
|
|
||||||
},
|
},
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"header": "Dashboard",
|
"header": "Dashboard",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user