Page 1 of 1

Bug when switching in Italian language

Posted: Wed Mar 01, 2023 10:56 pm
by yvesf
Hello,


I am experiencing a bug with a customer lucio/lucio which uses the italian language in his nubuilder profile. He was working previously in italian language and suddenly came back to me explaining that the application doesn't work anymore. Looking at it, I have found finally that changing the language solves the issue.
I have tried to switch to another language different than italian and it is working perfectly.
Looking into the database table zzzzsys_translate around italian words, nothing has changed : it is exactly the same records. (tested with extraction of all italian labels exported in xml format and then compare output files with compareit --> no difference between the pb base and a brand new base).
I don't know which records are involved in this language issue. It seems that the customers has been able to change something.
Any help would be highly appreciated. Database attached. If you switch lucio to italian, you cannot use the product anymore.

Yves

Re: Bug when switching in Italian language

Posted: Thu Mar 02, 2023 6:00 am
by kev1n
Hi Yves,

Have you done that?
If you encounter an issue, be sure to check the developer console for errors by clicking the `F12` key on most browsers.
I see errors:
2023-03-02_063741.png

Re: Bug when switching in Italian language

Posted: Thu Mar 02, 2023 6:37 am
by kev1n
I think this should fix it:

Replace:

Code: Select all

var d = { 'y': o[3], 'm': FMT[nuTranslateToEnglish(o[1])].jsmonth, 'd': o[2], 'h': time[0], 'n': time[1], 's': time[2] };	//-- today's date time[2]};	//-- today's date
with

Code: Select all

var d = { 'y': o[3], 'm': FMT[o[1]].jsmonth, 'd': o[2], 'h': time[0], 'n': time[1], 's': time[2] };	//-- today's date time[2]};	//-- today's date

https://github.com/nuBuilder/nuBuilder- ... s.js#L1026


PS: There's a typo in the form's Custom Code:

Now:

Code: Select all

    nuSetvalue ('inv_quantité', '1.00');
Corrected:

Code: Select all

    nuSetValue ('inv_quantité', '1.00');

Re: Bug when switching in Italian language

Posted: Thu Mar 02, 2023 8:07 am
by yvesf
Hello Kev1n,

Your correction has solved the issue. It is strange that it worked until yesterday ? How can we explain that ? Why the problem appears with italian language only ? Do I have to deploy this fix to the other projects ? Anyway many thanks for this and for the typo (ooops).

Yves

Re: Bug when switching in Italian language

Posted: Thu Mar 02, 2023 10:27 am
by kev1n
The problem has probably existed for some time, but in your case it causes the form to freeze. Have you updated nuBuilder recently?
The issue is that it tries to translate "Mar" (Short for March) into Italian (Tu), and then it looks that string up in a format object, which only contains English names. In short, if nuTranslateToEnglish() is removed, the problem no longer occurs.

Re: Bug when switching in Italian language

Posted: Thu Mar 02, 2023 10:03 pm
by yvesf
Kev1n,
Understood,many thx for your reactivity as usual. If you have time....

Yves

Re: Bug when switching in Italian language

Posted: Fri Mar 03, 2023 7:50 am
by kev1n
Fix is on Github.