joba-1 / Tasmoticz

Domoticz MQTT autodiscovery plugin for Tasmota devices
MIT License
24 stars 18 forks source link

Device naming in German? #24

Open FearNaBoinne opened 3 years ago

FearNaBoinne commented 3 years ago

Where does the module get names and such from? The devices generated were the friendly name with GERMAN extensions, whilst my Domoticz is set up in English...

Also when I look in the message/comment section, I see German phrases.

joba-1 commented 3 years ago

Hi,

the german messages are hardcoded in the sourcefiles since it is my native language. I asked how a plugin can determine the language main domoticz uses, but did not get an answer. So for now, all I could do are ugly worksrounds. One of them is ask you to change the handful of words in your copy and send a pull request so others can find it.

FearNaBoinne commented 3 years ago

Cool... NP! I can live with that for now... If I have some more time on my hands again, I will see what I can do for English (and detecting language?).

Barry40 commented 9 months ago

Is there a way around to do all coding in english please? I have ALOT tasmota devices upcoming, i do not like to rename everything. This plugin is working perfectly anyway, great job.

Thanks!!

joba-1 commented 9 months ago

Sorry, I don’t understand. Can you give an example of what you do, what you get and what you‘d like to get instead?

Barry40 commented 8 months ago

Sure,

All names of tasmota devices with this plugin are in German, i want to have it in english please 🙂

Barry40 commented 8 months ago

Screenshot_20231016_225741_Chrome Beta You can see here...

FearNaBoinne commented 8 months ago

The English would be "Voltage", "Current", "Total", "Yesterday", "Today", "Power" and "Apparent Power" (The unit of the latter should also be VA rather than Watt, but that is a different discussion altogether)

joba-1 commented 8 months ago

So it is basically the same answer as before: when I wrote the plugin I have not found a way to reliably detect the language a user wants and then how this usually is done in python. So for now there is no good mechanism for this :( Currently I can only recommend you change the names (and units) before the devices are created:

https://github.com/joba-1/Tasmoticz/blob/master/tasmota.py#L224

Probably I should revisit that, now that the plugin seems to have more than one user. Do you have an idea how to detect a users browser/domoticz language from within a domoticz plugin and how to do proper internationalization in python?