squarespace development + strategy + UX + design & build + marketing

+44 (0)7908 262225

I'm a freelance user experience consultant who delivers projects large and small for a client base that includes multinationals, SMEs, and sole traders.   
I specialise in formulating new media strategy, defining information architecture, user experience design, interaction design, prototyping, user research & testing, website and application building, and online marketing. 

Dynamic translation of Squarespace form error messages

Squarespace websites don't currently support localisation into non-English languages.

There are workarounds, using code injection and/or custom css that make it possible to localise a lot of the interface but, until now, there was no published solution for translating Squarespace form error messages.

The problem

When you load a Squarespace page that has a form on it, the error messages are not a part of the document. Instead, they are dynamically loaded by a validation script that runs when the form's submit button is pressed. 

This means that a simple script that runs on page load can't perform the translations, as the error messages are not yet a part of the page. 

The solution   

I wrote a script that fires off a listener when the Submit button is clicked.

This script checks every 100 milliseconds to see if an error field has become visible on the page.

If the script finds a visible error message  it steps through every error message on the page and swaps its English error message for the translated version. 

Demo 1 - Embedded form

Click submit without filling in the following form and you'll see the modified error messages.

Name *

Demo 2 - Lightbox form

Open the form then click submit without filling any fields and you'll see the modified error messages.

The Code

Code samples may be reused subject to certain conditions.

Notes -

  1. The code will work to translate the error messages for this form in this Squarespace template. It's probable that other templates have different error messages that would require a script modification for the translations to be applied.  
  2. Only the error messages are being translated here -the other form elements remain in English. 
<script type="text/javascript" src="//"></script>

<script type="text/javascript">

var formposted=0;

// Form error message translation. 
// Enter your English error messages here (don't forget full stop at end of message)
var errorEN = [
'Your form has encountered a problem. Please scroll down to review.',
'Your form has encountered a problem. Please scroll up to review.',
'Name is required.',
'Email Address is required.',
'Subject is required.',
'Message is required.'

//Enter your translated error messages here in the same order as above
var errorTR = [
'Voilà! - Your form has encountered a problem. Please scroll down to review.',
'Voilà! - Your form has encountered a problem. Please scroll up to review.',
'Quel con! - Name is required.',
'Bof! - Email Address is required.',
'Quel Con! - Subject is required.',
'Bof! - Message is required.'

    $('input.button').click(function() {
        window.setInterval(errTranslate, 100);

function errTranslate(){
    if(($(".field-error").is(':visible')) && (formposted==0)){
        $( ".field-error" ).each(function() {
            var errorText = $( this ).text();
            var numItems =  errorTR.length;
            for ( var i = 0; i < numItems; i++ ) {
                if (errorText == errorEN[i]) {$( this).text(errorTR[i] )};
        formposted = 1; 


Need Help With Localising Your Squarespace Site?

Squarespace site localisation is a service I offer.  

Use the form above to find out how I can help.