CMS Development

Luc_Benayoun
Member

Change HubSpot automatic messages strings on membership pages

SOLVE

Hi 🙂 

 

I'm currently working for an Italian customer with a registration process on their website (using HubSpot of course).

 

I'm trying to change some messages languages but it seems there's something preventing me from doing it.

 

As you can see on the screenshot, the red part is in french for me (because I'm in France) but sometimes it's in English, sometimes in another language, and so on.

 

How can I force it to be always in italian? I already tried to force the html_lang value to "it" but it doesn't work.

 

Any help would be highly appreciated 🙂

 

Capture d’écran 2022-09-23 à 18.21.03.png

0 Upvotes
1 Accepted solution
Anton
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Change HubSpot automatic messages strings on membership pages

SOLVE

Hi @Luc_Benayoun

is it a custom form? If so, you can modify the embed code with these options.

 

 

example:

 

default embed code:

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "na1",
    portalId: "xxxxxxx",
    formId: "xxxxxxxx",
    version: "V2_PRERELEASE"
  });
</script>

 

modified with translations:

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "na1",
    portalId: "xxxxxxxx",
    formId: "xxxxxxxx",
    version: "V2_PRERELEASE",
locale: 'en',
      translations: {
        en: {
          required: "Hey! That's required!",
          invalidDate: "Please enter a real date",
          submitText: "Custom Submit Button Text",
          submissionErrors:{ 
             MISSING_REQUIRED_FIELDS: "Please fill in all required fields!" 
          },
          fieldLabels: {
            email: "Electronic mail"
          }
        }
      }
  });
</script>

 

best, 

Anton

 

Anton Bujanowski Signature

View solution in original post

0 Upvotes
4 Replies 4
Anton
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Change HubSpot automatic messages strings on membership pages

SOLVE

Hi @Luc_Benayoun

is it a custom form? If so, you can modify the embed code with these options.

 

 

example:

 

default embed code:

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "na1",
    portalId: "xxxxxxx",
    formId: "xxxxxxxx",
    version: "V2_PRERELEASE"
  });
</script>

 

modified with translations:

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "na1",
    portalId: "xxxxxxxx",
    formId: "xxxxxxxx",
    version: "V2_PRERELEASE",
locale: 'en',
      translations: {
        en: {
          required: "Hey! That's required!",
          invalidDate: "Please enter a real date",
          submitText: "Custom Submit Button Text",
          submissionErrors:{ 
             MISSING_REQUIRED_FIELDS: "Please fill in all required fields!" 
          },
          fieldLabels: {
            email: "Electronic mail"
          }
        }
      }
  });
</script>

 

best, 

Anton

 

Anton Bujanowski Signature
0 Upvotes
Luc_Benayoun
Member

Change HubSpot automatic messages strings on membership pages

SOLVE

Hello Anton 🙂 

 

No it's not a custom form, it's a HubSpot login form (I use the HubSpot membership login module) so I can't test the solution you're providing. Do you have any other idea?

 

Best, 

Luc

0 Upvotes
Anton
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Change HubSpot automatic messages strings on membership pages

SOLVE

Hi @Luc_Benayoun

if performance isn't really a thing, you can always go the jQuery .replaceWith() or equivalent vanilla JavaScript route.

 

best, 

Anton

Anton Bujanowski Signature
0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Change HubSpot automatic messages strings on membership pages

SOLVE

Hey, @Luc_Benayoun 👋 Thanks for reaching out! Hey, @Jnix284 @Anton, do you have any tips for @Luc_Benayoun?

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot