Don't use the word column in section view (#21834)

This commit is contained in:
Paul Bottein 2024-08-29 15:30:25 +02:00 committed by GitHub
parent 1c9d411d3a
commit 362a6f46fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 13 deletions

View File

@ -2,7 +2,6 @@ import { LitElement, html } from "lit";
import { customElement, property } from "lit/decorators";
import memoizeOne from "memoize-one";
import { fireEvent } from "../../../../common/dom/fire_event";
import { LocalizeFunc } from "../../../../common/translations/localize";
import {
HaFormSchema,
SchemaUnion,
@ -25,7 +24,7 @@ export class HuiDialogEditSection extends LitElement {
@property({ attribute: false }) public viewConfig!: LovelaceViewConfig;
private _schema = memoizeOne(
(localize: LocalizeFunc, maxColumns: number) =>
(maxColumns: number) =>
[
{
name: "title",
@ -37,9 +36,6 @@ export class HuiDialogEditSection extends LitElement {
number: {
min: 1,
max: maxColumns,
unit_of_measurement: localize(
`ui.panel.lovelace.editor.edit_section.settings.column_span_unit`
),
},
},
},
@ -52,10 +48,7 @@ export class HuiDialogEditSection extends LitElement {
column_span: this.config.column_span || 1,
};
const schema = this._schema(
this.hass.localize,
this.viewConfig.max_columns || 4
);
const schema = this._schema(this.viewConfig.max_columns || 4);
return html`
<ha-form

View File

@ -5549,7 +5549,7 @@
"sections": "Sections (experimental)"
},
"subview": "Subview",
"max_columns": "Max number of columns",
"max_columns": "Max number of sections wide",
"subview_helper": "Subviews don't appear in tabs and have a back button.",
"edit_ui": "Edit in visual editor",
"edit_yaml": "Edit in YAML",
@ -5665,9 +5665,8 @@
"settings": {
"title": "Title",
"title_helper": "The title will appear at the top of section. Leave empty to hide the title.",
"column_span": "Size",
"column_span_unit": "columns",
"column_span_helper": "The size may be smaller if less columns are displayed (e.g. on mobile devices)."
"column_span": "Width",
"column_span_helper": "Larger sections will be made smaller to fit the display. (e.g. on mobile devices)"
},
"visibility": {
"explanation": "The section will be shown when ALL conditions below are fulfilled. If no conditions are set, the section will always be shown."