Load translations when adding item in pickers (#20325)
* Load translations when adding item in pickers * Update ha-selector-label.ts
This commit is contained in:
parent
169d782580
commit
21ed8e4206
|
@ -428,6 +428,8 @@ export class HaAreaPicker extends LitElement {
|
|||
|
||||
(ev.target as any).value = this._value;
|
||||
|
||||
this.hass.loadFragmentTranslation("config");
|
||||
|
||||
showAreaRegistryDetailDialog(this, {
|
||||
suggestedName: newValue === ADD_NEW_SUGGESTION_ID ? this._suggestion : "",
|
||||
createEntry: async (values) => {
|
||||
|
|
|
@ -437,6 +437,8 @@ export class HaFloorPicker extends SubscribeMixin(LitElement) {
|
|||
|
||||
(ev.target as any).value = this._value;
|
||||
|
||||
this.hass.loadFragmentTranslation("config");
|
||||
|
||||
showFloorRegistryDetailDialog(this, {
|
||||
suggestedName: newValue === ADD_NEW_SUGGESTION_ID ? this._suggestion : "",
|
||||
createEntry: async (values) => {
|
||||
|
|
|
@ -445,6 +445,8 @@ export class HaLabelPicker extends SubscribeMixin(LitElement) {
|
|||
|
||||
(ev.target as any).value = this._value;
|
||||
|
||||
this.hass.loadFragmentTranslation("config");
|
||||
|
||||
showLabelDetailDialog(this, {
|
||||
entry: undefined,
|
||||
suggestedName: newValue === ADD_NEW_SUGGESTION_ID ? this._suggestion : "",
|
||||
|
|
|
@ -30,6 +30,7 @@ export class HaLabelSelector extends LitElement {
|
|||
if (this.selector.label.multiple) {
|
||||
return html`
|
||||
<ha-labels-picker
|
||||
no-add
|
||||
.hass=${this.hass}
|
||||
.value=${ensureArray(this.value ?? [])}
|
||||
.disabled=${this.disabled}
|
||||
|
@ -41,6 +42,7 @@ export class HaLabelSelector extends LitElement {
|
|||
}
|
||||
return html`
|
||||
<ha-label-picker
|
||||
no-add
|
||||
.hass=${this.hass}
|
||||
.value=${this.value}
|
||||
.disabled=${this.disabled}
|
||||
|
|
|
@ -237,6 +237,8 @@ export class HaCategoryPicker extends SubscribeMixin(LitElement) {
|
|||
|
||||
(ev.target as any).value = this._value;
|
||||
|
||||
this.hass.loadFragmentTranslation("config");
|
||||
|
||||
showCategoryRegistryDetailDialog(this, {
|
||||
scope: this.scope!,
|
||||
suggestedName: newValue === ADD_NEW_SUGGESTION_ID ? this._suggestion : "",
|
||||
|
|
Loading…
Reference in New Issue