Translate Interface stuck on Loading translations...

More
5 years 1 month ago #75130 by mmirasol
Hello,

I have a survey which only displays Loading translations... when I try to do a quick translate.

The survey is done in the english language so I added French and tried to do a quick translate of all the fields, but the translate interface does not load.

My guess is that this happens because of the custom .js in questions because after I took out the .js code, the translate interface loaded quickly.

Please advise. I'm currently using Version 1.91+ Build 12416. Thanks.

Please Log in to join the conversation.

More
5 years 1 month ago #75135 by TMSWhite
Sorry, it is a more fundamental problem. The Google Translate API is no longer free, so the connections to the free service no longer work.

Google Translate does offer a paid service, but LS would need to be tweaked to let you enter your Google Translate account information so that you could connect in that fashion.

Please Log in to join the conversation.

More
5 years 1 month ago - 5 years 1 month ago #75136 by mmirasol
So it has to connect to Google Translate first before the pages load up? I mean the tabs and pages do not show at all. I'm not referring to the auto-translate function.

I'm stuck after I click Tools > Quick translation unless I take out the .js in the questions first.
Last Edit: 5 years 1 month ago by mmirasol.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75150 by DenisChenu

TMSWhite wrote: Sorry, it is a more fundamental problem. The Google Translate API is no longer free, so the connections to the free service no longer work.

Google Translate does offer a paid service, but LS would need to be tweaked to let you enter your Google Translate account information so that you could connect in that fashion.

Something i don't understand : google translate don't have to be called at page show, only after a "Auto translate" button ?

I don't like to call google each time i open this page.

mmirasol :

Please test if the problem still exists at the latest release . If so please open a ticket at the Bugtracker and...

  1. Give as much information as possible
  2. Attach your survey. You can mark your ticket "private" so that only the developers will be able to take a look at it.
  3. Provide step-by-step instructions how to reproduce the problem.
  4. If possible/helpful please provide screenshots

Afterwards please post the link to the Bugtracker so we can follow the progress.

Thanks!


:)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
5 years 3 weeks ago - 5 years 3 weeks ago #75188 by mmirasol
Hello Shnoulle,

Thanks for replying. =) I updated my version of lime to Version 1.91+ Build 120226 and still experienced the same thing.

I reviewed my code and saw that it only does this if the .js involves jquery manipulation of objects which are not displayed in the translate interface.

This is the part of my code that made the translate interface stick to Loading translations...

if(error_log == ''){
$('div.q3 td.answer input.radio')[0].checked = true;
}
else{
$('div.q3 td.answer input.radio')[1].checked = true;
$('div.q3 p.comment textarea').val(error_log);
}

I use this code to indicate whether the respondent passes the screening test and to populate the comment box with the reason if the respondent is not qualified. please see attached image.
Attachments:
Last Edit: 5 years 3 weeks ago by mmirasol.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75192 by DenisChenu
Oh yes !

We don(t have to translate script by default i think. Scripting in HTML editor can make very bad think.

I think the best is to deactivate HTML editor for user if you use a lot of scripting. See Default HTML editor mode: in global settings.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
5 years 3 weeks ago #75213 by mmirasol
Yes, Shnoulle. I still can't load the translate interface after changing the default html editor. Any suggestions on how I could separate the code from the text properly?

Can this be considered a bug?

Please Log in to join the conversation.

More
5 years 3 weeks ago - 5 years 3 weeks ago #75235 by tpartner
I don't think it's a bug with LimeSurvey.

Try this for your JavaScript:
if(error_log == ''){
	$('div.q3 td.answer input.radio:eq(0)').attr('checked', true);
}
else{
	$('div.q3 td.answer input.radio:eq(1)').attr('checked', true);
	$('div.q3 p.comment textarea').val(error_log);
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 5 years 3 weeks ago by tpartner.
The following user(s) said Thank You: mmirasol

Please Log in to join the conversation.

More
5 years 3 weeks ago #75321 by mmirasol
Hello tpartner. Thank you. This code works. =) Can you explain what's different about this code and why it doesn't cause the issue in the translate interface?

Please Log in to join the conversation.

More
5 years 3 weeks ago #75325 by tpartner
Your code seems to be a mixture of pure JavaScript and jQuery which could cause JavaScript errors preventing the execution of any following JavaScript. The quick translate requires JavaScript to work.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: mmirasol

Please Log in to join the conversation.

More
5 years 3 weeks ago - 5 years 3 weeks ago #75335 by mmirasol
I see. That's true. I'm still learning both, hehe. =) Thanks a lot, Tony. =)
Last Edit: 5 years 3 weeks ago by mmirasol.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75337 by tpartner
As am I - a never ending journey ;)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75351 by DenisChenu

tpartner wrote: Your code seems to be a mixture of pure JavaScript and jQuery which could cause JavaScript errors preventing the execution of any following JavaScript. The quick translate requires JavaScript to work.

I don't read the script before your intervention ;).

It's the $('div.q3 td.answer input.radio')[0] no ?

$('div.q3 td.answer input.radio') is not really a javascript array ?

Thanks to you :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.