Add lozalization to more-info-vacuum#4793
Conversation
| const supportsFanSpeed = supportsFeature( | ||
| stateObj, | ||
| VACUUM_SUPPORT_FAN_SPEED | ||
| ); | ||
| const supportsBattery = supportsFeature(stateObj, VACUUM_SUPPORT_BATTERY); | ||
| const supportsStatus = supportsFeature(stateObj, VACUUM_SUPPORT_STATUS); |
There was a problem hiding this comment.
Since we use these only once, it is nicer to inline the check instead of creating a const.
There was a problem hiding this comment.
Changed it to inline, except for supportsCommandBar as in my opinion it is clearer if it is a variable and not checked inline.
There was a problem hiding this comment.
Actually, I only meant the ones that were used once, the ones that are used twice (in supportsCommandBar) should be a const.
There was a problem hiding this comment.
Today I had another idea, I can use VACUUM_COMMANDS.some(...) so we don't have any duplicate code and the maintenance of the code is easier.
bramkragten
left a comment
There was a problem hiding this comment.
Looks great! Thanks. Just a few small remarks.
- Add different translation for start_pause and pause as they are not the same
|
The button |
|
Thanks for your suggestions :) |
Proposed change
Not translated
I have not translated
stateObj.attributes.status, because this attribute can be any value.Type of change
Example configuration
Additional information
I'm not sure if introducing the new class VacuumCommand was correct, but in my opinion it makes the code more clear and understandable.
I have separated each proposed into a separated commit, so it should be easier to see the different changes.
As this is my first pullrequest in this project, feel free to changes or to give me feedback :)
Checklist
If user exposed functionality or configuration variables are added/changed: