Please read the release notes carefully since this update requires adjustments to your Raspberry Pi configuration!
Wrote 2 modules already, but don't know where to start for another...
0lek last edited by
So just to make it clear: I wrote 2 modules already, they work beautifully. But now I have this idea in my mind and can’t find a way to implement it.
So what I’d like two do is to have a language changer module. Imagine airport boarding signs. They are always in the local language as well as English. They change every couple of seconds back and forth.
How can I do this? Is it even possible to do that via a module? I tried changing this.config.language on a loop, but that doesn’t do anything.
A pointer in the right direction is enough, I can figure the rest out.
cirdan last edited by
For a custom build calendar module, I implemented paging to make sure not all space is occupied. In the getdom I increment a global variable domstate everytime it is called. Based on the domstate and the number of pages I calculate which page to show. In your case, on even domstate you could display language one and when odd display language two.
0lek last edited by
@cirdan Thank you. This sounds like a good idea.
But oh boy, did I badly describe what I want to do.
I wasn’t talking about one module only, but about the whole mirror! So I’d like to have one module “MMM-LangChanger” that you can set up and that then changes the language of ALL the modules. So also the system clock module etc.
So somehow I need to set the language in the config, and then re-load the config without re-loading the mirror.
b/c if that’s NOT possible, I think the only way for me would be to add a custom code to EACH module (incl. the stock clock) and then to have LangChanger only send a socket notification. But that would NOT work with stock modules then…
doubleT last edited by
Check the code of those modules that can switch modules on/off (if they don’t just hide them, that is).
Basically, after changing the config, the browser has to be refreshed in order to load the the new configuration. What you want could be compared to that. Instead of removing a module, you change the language.