Welcome to the LimeSurvey Community Forum

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

Change button text

More
3 years 7 months ago #223934 by tammo
Change button text was created by tammo
LimeSurvey 5.2.11
Own server
Vanilla based custom theme

Previously this was discussed in:  forums.limesurvey.org/forum/can-i-do-thi...ange-the-next-button but since this was long ago and since the themes have changed significantly, this question arises again.

Under each page there is the "Next" button and at the last page there is the "Submit" button. 

What is needed to change the text of the "Submit" button and leave the text of the "Next" buttons unchanged in a survey in 1 language?


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
3 years 7 months ago #223940 by tammo
Replied by tammo on topic Change button text
Changing the language files is not an option, since there is a new release of LimeSurvey very often.

At updates the language files may be replaced by new versions, thereby deleting all custom updates.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
3 years 7 months ago #223945 by holch
Replied by holch on topic Change button text
You can always create your own language... nl-tm

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
3 years 7 months ago #223947 by tammo
Replied by tammo on topic Change button text
True, but that would still be difficult to maintain, since new language items may be introduced when the developers see the need for this.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
3 years 7 months ago #223956 by DenisChenu
Replied by DenisChenu on topic Change button text
With one or 2 languages : i create a survey theme github.com/LimeSurvey/LimeSurvey/blob/2e...n/navigator.twig#L54
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
3 years 7 months ago #223958 by Joffm
Replied by Joffm on topic Change button text
You want to change the text in only one language, but leave it in all others?

I tried this
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
  var lang = "{LANG}";
  if(lang=='en') {
  $('#ls-button-submit').text("My English Next Button");
  $('#ls-button-previous').text("My English Back Button"); 
  } 
});
</script>

 

 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 7 months ago #223960 by tammo
Replied by tammo on topic Change button text
I meant to say: I am using only one language. This would make it more simple, but your solution is more versatile.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
3 years 7 months ago #223961 by Joffm
Replied by Joffm on topic Change button text
Hm, that was my challenge; to find out how to get the language. 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tammo
The topic has been locked.
More
3 years 7 months ago #223962 by tammo
Replied by tammo on topic Change button text
Thank you Joff, this works beautifully!


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
3 years 7 months ago #223964 by DenisChenu
Replied by DenisChenu on topic Change button text
But ?
Why use JS if you need it for all surveys ?
Update the Surey theme is always better, no ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
3 years 7 months ago - 3 years 7 months ago #223965 by tammo
Replied by tammo on topic Change button text
Denis: Thank you, but I would like to touch the twig files as little as possible, because new code may be added during development and when I make an override, I miss these new developments.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Last edit: 3 years 7 months ago by tammo.
The topic has been locked.
More
3 years 7 months ago #223966 by tammo
Replied by tammo on topic Change button text
I may need it in multiple surveys, but each time the text in the end button may change...


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
3 years 7 months ago - 3 years 7 months ago #223967 by DenisChenu
Replied by DenisChenu on topic Change button text
But : js is new code too ?

Sorry : i try to understand why update theme is not a good solution.

I think we can include buttons , then maybe more easy ?

>I may need it in multiple surveys, but each time the text in the end button may change...

OK : create a SurveyTheme by survey seems awfull …
Add the string in SurveyTheme options ?
Sometimes i think to add unused data in SkelVanilla options …
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
Last edit: 3 years 7 months ago by DenisChenu. Reason: >I may need it in multiple surveys, but each time the text in the end button may change...
The topic has been locked.
More
3 years 7 months ago #223968 by tammo
Replied by tammo on topic Change button text
js is added to the survey, changing the twig files possibly makes updating the theme more difficult.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
3 years 7 months ago #223969 by Joffm
Replied by Joffm on topic Change button text
If you want to keep the text "next" or "volgende" or ...  you may create a hidden question at the very end of the survey.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose