Change button text

More
3 months 6 days 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.

 
Attachments:

Please Log in to join the conversation.

More
3 months 6 days 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.

$(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.

Please Log in to join the conversation.

More
3 months 6 days ago #219395 by brais24
Replied by brais24 on topic Change button text
I try it but dont work, i attach image.

 
Attachments:

Please Log in to join the conversation.

More
3 months 6 days 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.

Please Log in to join the conversation.

More
3 months 5 days 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.

Please Log in to join the conversation.

More
3 months 5 days ago - 3 months 5 days 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 : 

<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: 3 months 5 days ago by DenisChenu. Reason: Fix bbcode
The following user(s) said Thank You: tpartner

Please Log in to join the conversation.

More
3 months 5 days 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.

Please Log in to join the conversation.

More
3 months 5 days ago - 3 months 5 days 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: 3 months 5 days ago by tpartner.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
3 months 5 days 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.
Attachments:
The following user(s) said Thank You: tpartner

Please Log in to join the conversation.

More
3 months 5 days 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 : 

<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.

Please Log in to join the conversation.

More
3 months 1 day 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')
        }
    });
});

 
Attachments:

Please Log in to join the conversation.

More
3 months 1 day 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.

Please Log in to join the conversation.

More
3 months 4 hours ago #219551 by tpartner
Replied by tpartner on topic Change button text
There is no Bootstrap modal pop-up on that page so you need to remove that event listener.

Try this (assuming your button ID is correct):

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

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
2 months 4 weeks ago #219569 by brais24
Replied by brais24 on topic Change button text
Thank you!! Works like a charm, I have to improve my javascript.

Thanks to all.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now