MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

Translation "After one month" in Calendar Module

  • Can someone tell me where I can change the text “Over één maand” in the Calendar Module? It is my intention to replace it with “Over een maand” (in English something like “After one month”).

    0_1518166047189_Schermafbeelding 2018-02-09 om 09.43.19.jpg

  • Moderator

    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?

  • Moderator

    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 :
    //! author : Jacob Middag :
    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.

  • 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 😞

  • Moderator

    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 🙂

  • Thanks Stefan, I appreciate your help!

  • @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 :

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

  • @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.

  • Moderator

    That’s strange. I will check on my mirror tomorrow

  • @yawns

    Possibly it is a browser cache problem, I use an Android tablet and a full screen browser within my mirror ( 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…

Log in to reply