Translated developer tools events page#4033
Conversation
| "start_listening": "Start listening", | ||
| "stop_listening": "Stop listening", | ||
| "alert_event_type": "Event type is a mandatory field", | ||
| "notification_event_fired": "Event {type} successful fired!" |
There was a problem hiding this comment.
I don't see this one in your code?
There was a problem hiding this comment.
Oh my bad. Not sure why I did not use start/stop_listening. Though I wanted to use alert_event_type and notification_event_fired in developer-tools-event.js here:
fireEvent() {
if (!this.eventType) {
alert("Event type is a mandatory field");
return;
}
this.hass.callApi("POST", "events/" + this.eventType, this.parsedJSON).then(
function() {
this.fire("hass-notification", {
message: "Event " + this.eventType + " successful fired!",
});
}.bind(this)
);
}However, could not figure out how to use this.hass.localize() in this contex, the frontend always showed blank instead of the translated text.
Is there anything I have to take into account?
There was a problem hiding this comment.
should work, what was your code?
There was a problem hiding this comment.
Not sure what I did wrong before, but now it works flawlessly. Updated my code with 923cfe7.
…firing an event), Removed unnecessary translation key-value pairs
| "start_listening": "Start listening", | ||
| "stop_listening": "Stop listening", |
There was a problem hiding this comment.
The two are used in event-subscribe-card.ts
There was a problem hiding this comment.
Sorry thought you linked to them as well and that I did not use them. Fixed with 4a1f602.
Issue affected: #3429
Description:
Result:
