• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Wrote 2 modules already, but don't know where to start for another...

Scheduled Pinned Locked Moved Development
4 Posts 3 Posters 1.5k Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 0 Offline
    0lek
    last edited by Feb 2, 2018, 12:21 PM

    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. :)

    Thanks!

    1 Reply Last reply Reply Quote 0
    • C Offline
      cirdan
      last edited by Feb 2, 2018, 3:34 PM

      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.

      Modules MMM-rainfc, MMM-bustimes, MMM-Harmony, MMM-Rijks

      1 Reply Last reply Reply Quote 0
      • 0 Offline
        0lek
        last edited by Feb 2, 2018, 4:24 PM

        @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…

        1 Reply Last reply Reply Quote 0
        • D Offline
          doubleT Module Developer
          last edited by Feb 2, 2018, 5:21 PM

          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.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            1/4
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy