Welcome to the LimeSurvey Community Forum

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

Change button text

  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 7 months ago #219391 by brais24
Change button text was created by brais24
Hi there people, I made a survey on Galician Language, and Ive notice that the OK button on the popup when you push "save and clear", on Galician Language have a bad translate, is there any way to edit that button? My survey only have that language, I dont know if I can change it on the theme, and, if i can do it by that, where I found the text to edit it?

I have the  3.25.6+201229  version, I attach an image and mark with yellow the button that I want to edtit, Ive looking for information about this but dont found nothing.

Thanks for the help.

 
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #219393 by tpartner
Replied by tpartner on topic Change button text
I don't think you can modify the modal pop-ups via the theme manager but you have two other options.

1) Edit the translation - manual.limesurvey.org/Translating_LimeSurvey

2) Add something like this to your custom.js file. It will detect when the modal is shown and modify the button text.

Code:
$(document).on('ready pjax:scriptcomplete',function(){
 
  // Modify clearall button text
  $('body').on('show.bs.modal', function(e) {
    if($.trim($('#identity__bsconfirmModal_button_ok').text()) == 'Valeu') {
      $('#identity__bsconfirmModal_button_ok').text('Está ben')
    }
  });
});

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 7 months ago #219395 by brais24
Replied by brais24 on topic Change button text
I try it but dont work, i attach image.

 
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 7 months ago #219396 by brais24
Replied by brais24 on topic Change button text
Ok, now it works, I dont have to change the first option, I have to change the second.

Thank you.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #219403 by holch
Replied by holch on topic Change button text
If the translation is actually wrong, please correct it for the Galician translation.
translate.limesurvey.org/projects/

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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago - 2 years 7 months ago #219423 by DenisChenu
Replied by DenisChenu on topic Change button text

I don't think you can modify the modal pop-ups via the theme manager but you have two other options.


I think you can (except if someone broke the functionality after implementation) Just after <body> or somewhere like this : 

Code:
<script>
LSvar.lang.confirm.confirm_cancel = "My cancel";
LSvar.lang.confirm.confirm_ok = "My cancel";
</script>
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 2 years 7 months ago by DenisChenu. Reason: Fix bbcode
The following user(s) said Thank You: tpartner
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #219426 by DenisChenu
Replied by DenisChenu on topic Change button text

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago - 2 years 7 months ago #219429 by tpartner
Replied by tpartner on topic Change button text

Else : github.com/LimeSurvey/LimeSurvey/blob/ma...rap_alert_modal.twig
for other modal.
Yes, but, as far as I can see, it's not accessible via the theme manager without modifying the <template_editor> files.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 2 years 7 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #219430 by DenisChenu
Replied by DenisChenu on topic Change button text

Else : github.com/LimeSurvey/LimeSurvey/blob/ma...rap_alert_modal.twig
for other modal.
Yes, but, as far as I can see, it's not accessible via the theme manager without modifying the <template_editor> files.

 
Yes , in skelvanilla i add it in error.
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: tpartner
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #219437 by tpartner
Replied by tpartner on topic Change button text

I think you can (except if someone broke the functionality after implementation) Just after <body> or somewhere like this : 

Code:
<script>
LSvar.lang.confirm.confirm_cancel = "My cancel";
LSvar.lang.confirm.confirm_ok = "My cancel";
</script>
 
This does still work in 5.1.5 but I'm surprised at how few items there are in the LSvar.lang object.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 7 months ago #219525 by brais24
Replied by brais24 on topic Change button text
Ok, I submit the translation, but i have another question, ¿it is possible to change the text of the "Save now" button on the save and continue later screen? I try it with the same javascript changing the ID like this, but dont work, I attach image of the button

$(document).on('ready pjax:scriptcomplete',function(){
 
    // Modify clearall button text
    $('body').on('show.bs.modal', function(e) {
        if($.trim($('#savebutton').text()) == 'Gardar Agora') {
            $('#savebutton').text('Gardar agora')
        }
    });
});

 
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 7 months ago #219526 by brais24
Replied by brais24 on topic Change button text
Is the screen to save the survey to continue later.

Thanks for the help.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose