MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. winstonma
    3. Topics
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    W
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 12
    • Groups 0

    Topics

    • W

      Use Javascript to modify the module header

      Watching Ignoring Scheduled Pinned Locked Moved Development
      3
      0 Votes
      3 Posts
      355 Views
      W
      @C-son said in Use Javascript to modify the module header: this.data.header = ‘My header is awesome’; Thanks
    • W

      How to support multiple translations in different UI and API?

      Watching Ignoring Scheduled Pinned Locked Moved Development
      1
      0 Votes
      1 Posts
      187 Views
      W
      My modules would like to support multiple languages (e.g. zh-hk and zh-tw). But actually both language uses the same set of language (Traditional Chinese). UI I could support both language in the following function: getTranslations: function () { return { ... "zh-hk": "translations/zh-tw.json" "zh-tw": "translations/zh-tw.json" }; Is it possible that I could pre-map zh-hk to zh-tw so that I only need to keepzh-tw in getTranslations? API The API also returned the localized value based on the language parameters. Therefore I would like to convert zh-hk and zh-tw into zh-hant required by the API (in two different lines). Currently I am doing the conversion in a hard-code way. Is it possible that I could pre-map zh-hk to zh-tw so that I could translatezh-tw into zh-hant in the API code?
    • W

      How to get Nullish coalescing operator working in a module?

      Watching Ignoring Scheduled Pinned Locked Moved Requests
      2
      0 Votes
      2 Posts
      301 Views
      S
      @winstonma according to the spec, u need node version 14 or above https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator and some work by the browser, altho I can’t find any info on electron support
    • W

      How to obtain the current language setting?

      Watching Ignoring Scheduled Pinned Locked Moved Development
      3
      0 Votes
      3 Posts
      406 Views
      ?
      sure ;) config is the entire config file, so you can read it with for example console.log(config)
    • W

      Schedule update?

      Watching Ignoring Scheduled Pinned Locked Moved Development
      1
      0 Votes
      1 Posts
      935 Views
      W
      I have created a module that would display Estimated Time of Arrival (ETA) in Hong Kong. The tough thing would be there are multiple route will stop at one bus stop, and I need to find the URL for each route. So my program will have several parts. At load time, it will generate URL for each route It will load all the routes that will go through that bus stop Then for each route I need to find the corresponding URL for each route For each route it will find out the corresponding ETA URL For each ETA URL, it will poll every minute and update the info in Magic Mirror But there are few problems here. I would like to update the ETA URL “Every 5am”, how the schedule can be done? Currently my work only support one bus stop but I would like to include multiple bus stops, how could I change the structure in node_helper.js to accommodate that? Thanks in advance
    • W

      Multiple API Requests

      Watching Ignoring Scheduled Pinned Locked Moved Development
      3
      0 Votes
      3 Posts
      2k Views
      W
      Thanks for the reply. I think my major question is, how can I make multiple asynchronous API calls (for obtaining the Stop info as well as obtaining the ETA for each route). Any example would be a great (pipe requests). Thanks for the help.
    • 1 / 1