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.

    Translation "After one month" in Calendar Module

    Scheduled Pinned Locked Moved Troubleshooting
    15 Posts 4 Posters 7.7k 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.
    • yawnsY Offline
      yawns Moderator
      last edited by

      If I am not mistaken this text comes from moment.js using translations based on the locale you set. I guess you use dutch translation, right?

      yawnsY 1 Reply Last reply Reply Quote 0
      • yawnsY Offline
        yawns Moderator @yawns
        last edited by

        Yep, looks like I am right. This is found in moment.js locale settings. In this case it uses the future variable and M from relativeTime

        //! moment.js locale configuration
        //! locale : Dutch [nl]
        //! author : Joris Röling : https://github.com/jorisroling
        //! author : Jacob Middag : https://github.com/middagj
        
        var monthsShortWithDots$2 = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
        var monthsShortWithoutDots$2 = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
        
        var monthsParse$3 = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
        var monthsRegex$4 = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
        
        hooks.defineLocale('nl', {
            months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
            monthsShort : function (m, format) {
                if (!m) {
                    return monthsShortWithDots$2;
                } else if (/-MMM-/.test(format)) {
                    return monthsShortWithoutDots$2[m.month()];
                } else {
                    return monthsShortWithDots$2[m.month()];
                }
            },
        
            monthsRegex: monthsRegex$4,
            monthsShortRegex: monthsRegex$4,
            monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
            monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
        
            monthsParse : monthsParse$3,
            longMonthsParse : monthsParse$3,
            shortMonthsParse : monthsParse$3,
        
            weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
            weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
            weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'),
            weekdaysParseExact : true,
            longDateFormat : {
                LT : 'HH:mm',
                LTS : 'HH:mm:ss',
                L : 'DD-MM-YYYY',
                LL : 'D MMMM YYYY',
                LLL : 'D MMMM YYYY HH:mm',
                LLLL : 'dddd D MMMM YYYY HH:mm'
            },
            calendar : {
                sameDay: '[vandaag om] LT',
                nextDay: '[morgen om] LT',
                nextWeek: 'dddd [om] LT',
                lastDay: '[gisteren om] LT',
                lastWeek: '[afgelopen] dddd [om] LT',
                sameElse: 'L'
            },
            relativeTime : {
                future : 'over %s',
                past : '%s geleden',
                s : 'een paar seconden',
                ss : '%d seconden',
                m : 'één minuut',
                mm : '%d minuten',
                h : 'één uur',
                hh : '%d uur',
                d : 'één dag',
                dd : '%d dagen',
                M : 'één maand',
                MM : '%d maanden',
                y : 'één jaar',
                yy : '%d jaar'
            },
            dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
            ordinal : function (number) {
                return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
            },
            week : {
                dow : 1, // Monday is the first day of the week.
                doy : 4  // The week that contains Jan 4th is the first week of the year.
            }
        });
        
        1 Reply Last reply Reply Quote 1
        • M Offline
          MM-Hans
          last edited by

          Thanks! And yes you’re right, it is Dutch. But what is the path to moment.js? I guess it is outside MagicMirror but could not find it :-(

          1 Reply Last reply Reply Quote 0
          • yawnsY Offline
            yawns Moderator
            last edited by

            The path is ~/MagicMirror/node_modules/moment/locale/nl.js

            Before making any changes to this file I reccomend making a backup of the file :)

            1 Reply Last reply Reply Quote 0
            • M Offline
              MM-Hans
              last edited by

              Thanks Stefan, I appreciate your help!

              pjkoelemanP 1 Reply Last reply Reply Quote 0
              • pjkoelemanP Offline
                pjkoeleman @MM-Hans
                last edited by

                @MM-Hans said in Translation “After one month” in Calendar Module:

                Thanks Stefan, I appreciate your help!

                I answer this in Dutch because otherwise it will be difficult to explain. The used notation in moment.js is correct.

                Getallen tot twintig (20) worden normalieter uitgeschreven. Op het getal een worden accenten geplaatst als het een telwoord is.
                Uitzondering hierop is in samenstellingen met een worden geen accenten op de ee gezet, ook niet als het telwoord één bedoeld is.
                Voorbeeld hiervan is eendagsvlieg.

                Bron : onzetaal.nl

                No reason to change this, why would you like to do this?

                M 1 Reply Last reply Reply Quote 1
                • M Offline
                  MM-Hans @pjkoeleman
                  last edited by

                  @pjkoeleman

                  Thanks for your posting. When an event is over, let’s say, five weeks MM displays “één maand”. But in my opinion “één” means more exactly one month and not “een maand”. In English “one month” vs. “a month”. So I would like to change it. I have found two installs of moment.js and translated in both “één” to “een” but after rebooting and power off several times it was not translated on the mirror so far.

                  yawnsY 1 Reply Last reply Reply Quote 0
                  • yawnsY Offline
                    yawns Moderator @MM-Hans
                    last edited by

                    @MM-Hans
                    That’s strange. I will check on my mirror tomorrow

                    M 1 Reply Last reply Reply Quote 0
                    • M Offline
                      MM-Hans @yawns
                      last edited by

                      @yawns

                      Possibly it is a browser cache problem, I use an Android tablet and a full screen browser within my mirror (http://192.168.2.xxx:8080). In that case there must be a way to refresh the MM tablet page, preferable from the MM install on the RPi. Something with “nocache”? I’m not sure…

                      1 Reply Last reply Reply Quote 0
                      • B Offline
                        barnosch
                        last edited by

                        maybe a stupid question,
                        but why do you want to see a event on your mirror,
                        which was already one month ago?
                        Or if i did not catched the timeing correctly, why do you want to see events which are more then one month away?
                        ;)

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          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