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

More
10 years 10 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.
More
10 years 10 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:
www.limesurvey.org/manual/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.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
10 years 10 months ago - 10 years 10 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: 10 years 10 months ago by tpartner.
The following user(s) said Thank You: mstolk
The topic has been locked.
More
10 years 10 months ago #127704 by mstolk
Now it works, whoop whoop! Thank you so much!
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose