Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Change the submit button text for different languages

  • mstolk
  • mstolk's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #127578 by mstolk
Hi,

I am looking for a way to change the submit-button-text of my test.
The test has a Dutch and an English version.

When I searched the forum, I found the following code (and other variations) that work perfectly when put in template.js:

$(document).ready(function(){
var submitText = 'Next';
$('#movesubmitbtn .ui-button-text').text(submitText);
});

But then it's changed to "Next" also in the Dutch version.

I also found topics about changing translations for other languages, but it seemed difficult/timeconsuming (downloading a programme and adjust a language-file I don't really understand where to find), so I was wondering if there is another way.

I thought about an adjustment in the code with something like,
if (lang='en') show the submitText, else show another text.
But I do not really know how these codes work.

I really hope somebody can help me out :-)

mstolk
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 6 months ago #127582 by holch
I can assure you, finding the language files and using po-edit is probably not that much work. 2 minutes of reading in the manual should get you started:
manual.limesurvey.org/Translating_LimeSurvey

You can find the files usually here (example for french):
/locale/fr/LC_MESSAGES/fr.po

Poedit is a small and simple program to work on these .po files. However, keep in mind the changes can and will be overwritten by updates.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 6 months ago - 8 years 6 months ago #127594 by tpartner
Try something like this:

Code:
$(document).ready(function(){
  var lang = $('html')[0].lang
  if(lang == 'en') {
    var submitText = 'New Next';
    $('#movesubmitbtn .ui-button-text').text(submitText);
  }
});

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 6 months ago by tpartner.
The following user(s) said Thank You: mstolk
The topic has been locked.
  • mstolk
  • mstolk's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #127704 by mstolk
Now it works, whoop whoop! Thank you so much!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose