Skip to content

Commit

Permalink
Update entity_not_supported error message
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBartusek committed Aug 9, 2021
1 parent bf7efaa commit 9aa6761
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default class Data
}
}

return [ topElement, topIndex];
return [topElement, topIndex];
}

static getLevelByID(id)
Expand Down
6 changes: 5 additions & 1 deletion src/meteoalarm-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ class MeteoalarmCard extends LitElement

if(result.awarenessLevel == undefined || result.awarenessType == undefined)
{
throw Error(localize('error.entity_not_supported'));
throw Error(
localize('error.entity_invalid')
.replace('{entity}', `(${entity.entity_id})`)
.replace('{integration}', `(${this.integration.name})`)
);
}

if(result.headline === undefined || this.overrideHeadline)
Expand Down
2 changes: 1 addition & 1 deletion src/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"missing_entity": "Die angegebene Entität ist nicht vorhanden!",
"invalid_integration": null,
"automatic_failed": null,
"entity_not_supported": null
"entity_invalid": null
},
"editor": {
"entity": null,
Expand Down
2 changes: 1 addition & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"missing_entity": "Specifying entity is required!",
"invalid_integration": "This integration is not valid!",
"automatic_failed": "Failed to automatically detect integration!",
"entity_not_supported": "This integration doesn't support provided entity!"
"entity_invalid": "This entity {entity} cannot be parsed by selected integration {integration}"
},
"editor": {
"entity": "Entity",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"missing_entity": "¡Se requiere especificar la entidad!",
"invalid_integration": "¡Esta integración no es válida!",
"automatic_failed": "¡No se pudo detectar automáticamente la integración!",
"entity_not_supported": "¡Esta integración no es compatible con la entidad proporcionada!"
"entity_invalid": null
},
"editor": {
"entity": "Entidad",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"missing_entity": "Vajalik on Meteoalarmi olem!",
"invalid_integration": "Meteoalarmi sidumine on vale!",
"automatic_failed": null,
"entity_not_supported": null
"entity_invalid": null
},
"editor": {
"entity": "Olem",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"missing_entity": "L'entité est requise!",
"invalid_integration": "Cette intégration n'est pas valide!",
"automatic_failed": "La detection automatique de l'intégration à échoué!",
"entity_not_supported": "Cette intégration ne supporte pas l'entité fournie!"
"entity_invalid": null
},
"editor": {
"entity": "Entité",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"missing_entity": "È necessario specificare un'entità!",
"invalid_integration": null,
"automatic_failed": null,
"entity_not_supported": null
"entity_invalid": null
},
"editor": {
"entity": null,
Expand Down
2 changes: 1 addition & 1 deletion src/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"missing_entity": "Het specificeren van de entiteit is vereist!",
"invalid_integration": "Deze integratie is niet geldig!",
"automatic_failed": null,
"entity_not_supported": null
"entity_invalid": null
},
"editor": {
"entity": "Entiteit",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"missing_entity": "Podanie encji jest wymagane!",
"invalid_integration": "Nieprawidłowa integracja!",
"automatic_failed": "Bład automatycznego wykrywania integracji!",
"entity_not_supported": "Ta integracja nie wspiera podanej encji!"
"entity_invalid": "Ta encja {entity} nie może zostać zinterpretowana przed integracje {integration}"
},
"editor": {
"entity": "Encja",
Expand Down
6 changes: 3 additions & 3 deletions src/translations/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"missing_entity",
"invalid_integration",
"automatic_failed",
"entity_not_supported"
"entity_invalid"
],
"properties": {
"missing_entity": {
Expand All @@ -60,8 +60,8 @@
"$id": "#/properties/error/properties/automatic_failed",
"type": ["string", "null"]
},
"entity_not_supported": {
"$id": "#/properties/error/properties/entity_not_supported",
"entity_invalid": {
"$id": "#/properties/error/properties/entity_invalid",
"type": ["string", "null"]
}
},
Expand Down

0 comments on commit 9aa6761

Please sign in to comment.