VRM translation

Hi developers,

I am not an English native speaker, so I may be wrong.

In VRM, in places where it says: “Last updated”, you can find texts like “in a few seconds” or “in a minute”.

But those forms (“in a …”) are referring to a future tense, not a past tense, like “Last updated”.

Isn’t it more correct like “a few seconds ago” or “a minute ago”, by using “… ago” ?

Thanks!

Odd one that, mine are working OK with the correct wording.

@Barbara

I am talking about release VRM, not beta.
Sorry not mentioning that, but I don’t know where to post problems about release VRM.
Also, the same bad wording for French, Italian, etc.

Another observation…

On Android devices, the wording is correct.
Is it because of the layout detection, OS detection or web browser type?

@pwfarnell
Your printscreen is from a tablet or a desktop PC?

Desktop PC. Text OK on Android phone.

Very observant @alexpescaru .
Evening looks correct on my devices. Places I have looked:

  1. VRM app on Android phone
  2. Chrome browser on Android
  3. iPhone app on SE
  4. Safari on iPhone
  5. iPhone widget
  6. Win 10 tablet via FF
  7. Win 11 laptop via FF and Chrome
    F.

On VRM installations…

Surely these texts are stored somewhere.
It should be looked why for some systems the server is sending the correct text, for others no.

Hi Alex,

I have never seen that ‘in a minute’ text, nor is there any translation in the VRM localization code that has that.

Could it be that you have a translate plugin active in your browser? It might be that that automatically translates the text wrong, and that’s why it looks OK for others and for you on other devices.

Hope that helps!

No translation plugins.
Neither in Firefox, nor the Chrome.

Here below for other languages, after I’ve changed them through VRM → Preferences → Language
Italian, where it should be “un minuto fa”, not “tra un minuto”

Or in French, where it should be “il y a une minute”, not “dans une minute”

Or Spanish, where it should be “hace un minuto”, not “en un minuto”

All of them are in the future, not in the past…
The text is filled by your server…


5

@Barbara

You seem that you are using Petr Bela’s “moment” library for manipulating dates, or forked code based on this.

In one of the files in:
node_modules/moment-timezone/node_modules/moment/locale/xx.js
node_modules/moment/locale/xx.js

somehow the parameter (isFuture) is badly sent.
Therefore the problem with the future formulation.

Kindly please, take a look at those files.
The text we are talking about is not stored in a “locale” database, but dynamically built inside the functions, based on parameters passed.

Example for French

;(function (global, factory) {
   typeof exports === 'object' && typeof module !== 'undefined'
       && typeof require === 'function' ? factory(require('../moment')) :
   typeof define === 'function' && define.amd ? define(['../moment'], factory) :
   factory(global.moment)
}(this, (function (moment) { 'use strict';

    //! moment.js locale configuration

    var monthsStrictRegex =
            /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
        monthsShortStrictRegex =
            /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,
        monthsRegex =
            /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
        monthsParse = [
            /^janv/i,
            /^févr/i,
            /^mars/i,
            /^avr/i,
            /^mai/i,
            /^juin/i,
            /^juil/i,
            /^août/i,
            /^sept/i,
            /^oct/i,
            /^nov/i,
            /^déc/i,
        ];

    var fr = moment.defineLocale('fr', {
        months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
            '_'
        ),
        monthsShort:
            'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
                '_'
            ),
        monthsRegex: monthsRegex,
        monthsShortRegex: monthsRegex,
        monthsStrictRegex: monthsStrictRegex,
        monthsShortStrictRegex: monthsShortStrictRegex,
        monthsParse: monthsParse,
        longMonthsParse: monthsParse,
        shortMonthsParse: monthsParse,
        weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
        weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
        weekdaysMin: 'di_lu_ma_me_je_ve_sa'.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: '[Aujourd’hui à] LT',
            nextDay: '[Demain à] LT',
            nextWeek: 'dddd [à] LT',
            lastDay: '[Hier à] LT',
            lastWeek: 'dddd [dernier à] LT',
            sameElse: 'L',
        },
        relativeTime: {
            future: 'dans %s',
            past: 'il y a %s',
            s: 'quelques secondes',
            ss: '%d secondes',
            m: 'une minute',
            mm: '%d minutes',
            h: 'une heure',
            hh: '%d heures',
            d: 'un jour',
            dd: '%d jours',
            w: 'une semaine',
            ww: '%d semaines',
            M: 'un mois',
            MM: '%d mois',
            y: 'un an',
            yy: '%d ans',
        },
        dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
        ordinal: function (number, period) {
            switch (period) {
                // TODO: Return 'e' when day of month > 1. Move this case inside
                // block for masculine words below.
                // See https://github.com/moment/moment/issues/3375
                case 'D':
                    return number + (number === 1 ? 'er' : '');

                // Words with masculine grammatical gender: mois, trimestre, jour
                default:
                case 'M':
                case 'Q':
                case 'DDD':
                case 'd':
                    return number + (number === 1 ? 'er' : 'e');

                // Words with feminine grammatical gender: semaine
                case 'w':
                case 'W':
                    return number + (number === 1 ? 're' : 'e');
            }
        },
        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.
        },
    });

    return fr;

})));

I do have a side item of interest.

We have two sites that used to have wind solar priority on them. Their use cases have changed but the battery widget still shows the wind solar on them. There is no way for the end use or myself to remove it.

VRM Portal ID
c0619ab22ec2
VRM Site ID
372397

VRM Portal ID
c0619ab679e0
VRM Site ID
714255

Hey,

We do use this package only on the event log page. For other pages we use a localization tool to collaborate with translators, but ‘In a minute’ is not showing up anywhere there.

Anyway, something is happening.
You saw the printscreens and the translations and it’s not only for English. It’s for all other languages.
Somehow the time reference passed is for the future time, or time difference is with the wrong sign.
I have the feeling that’s also based on the web explorer agent description. Remember, we had this discussion, I am using LTS versions…

Hi @Barbara
Don’t know what happened, but now it’s OK.
See below for English, the other languages are also OK.
Hope that was your team finding out the problem.
If that’s the case, many thanks and what was the problem?

Hi Alex.

I did think i saw something like this too but i was to slow to get a screenshot

When I’ve encountered issues like this in the past, it often turned out to be a caching problem on a server somewhere. These can be quite tricky to track down and usually resolve themselves after a server reboot or update etc…

It’s hard to say for sure in this case, though!
Glad it’s okay now but worth keeping an eye on.

Dave