Some UI copy can't be changed in user-related blocks

Hi everyone,

I’m building a website in Spanish and I found that there are some components for which the text can’t be changed, and thus I can’t translate them.

Some examples:

  1. Sign in / sign up with Google buttons:

image

image

Just FYI: the device language doesn’t have anything to do with this.

  1. Agree to the terms of use and privacy policy (sign up block)
    image

I can only change the words for “terms of use” and “privacy policy”, but not the sentence in which they’re contained.

  1. The update password part of the user profile block (the one you use to let users edit their own data). In this case, the labels can’t be changed and remain in English.
    image

Thanks!

Try this custom code on your sign-up page to get the right words on your accept checkbox:

<script>
    window.addEventListener('block-loaded-yourBlockName', () => {
       var label = document.querySelector("label[for='terms_and_privacy']");
       var paragraph = label.querySelector('p');
       var childElements = paragraph.children;
       
       var paragraph1 = childElements[0];
       var paragraph2 = childElements[1];
       
       paragraph1.firstChild.textContent = 'Acepto los';
       var linkElement1 = paragraph1.querySelector('a');
       linkElement1.textContent = 'Términos';
       
       paragraph2.firstChild.textContent = 'y';
       var linkElement2 = paragraph2.querySelector('a');
       linkElement2.textContent = 'Política de privacidad';
    });
</script>
1 Like

Hello @funkycoldmedina, here is a code to translate the ‘Sign in with Google’ button:

<script>
    window.addEventListener('block-loaded-BLOCKID', () => {
        setTimeout(()=>{
           document.querySelector('#BLOCKID button span').innerText = 'TRANSLATION'
        }, 100);
    });
</script>

and a code to translate ‘Old password’ and ‘New password’ in User Profile block

<script>
    window.addEventListener('block-loaded-BLOCKID', () => {
        setTimeout(()=>{
            [...document.querySelectorAll('#BLOCKID .form-input-label')].forEach((label)=>{
            if(label.innerText == "Old password"){
                label.innerText = "TRANSLATION FOR OLD PASSWORD"
            }
            if(label.innerText == "New password"){
                label.innerText = "TRANSLATION FOR NEW PASSWORD"
            }
        })
        }, 100);
    });
</script>
1 Like

Thanks @acjnas @Astghik !

Would be awesome if those are natively customizable at some point

A big redesign/improvement is coming soon for blocks so we will consider this improvements in its’ scope

2 Likes

Sounds great!

I’m genuinely excited for what you’re building.

1 Like