- Posts: 5
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
8 years 5 months ago #127578
by mstolk
Change the submit button text for different languages was created 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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11637
- Thank you received: 2737
8 years 5 months ago #127582
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Change the submit button text for different languages
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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10098
- Thank you received: 3589
8 years 5 months ago - 8 years 5 months ago #127594
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Change the submit button text for different languages
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 5 months ago by tpartner.
The following user(s) said Thank You: mstolk
The topic has been locked.
- mstolk
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
8 years 5 months ago #127704
by mstolk
Replied by mstolk on topic Change the submit button text for different languages
Now it works, whoop whoop! Thank you so much!
The topic has been locked.