CMS Development

Luc_Benayoun
Mitglied

Change HubSpot automatic messages strings on membership pages

lösung

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 Akzeptierte Lösung
Anton
Lösung
Trendsetter/-in

Change HubSpot automatic messages strings on membership pages

lösung

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

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
4 Antworten
Anton
Lösung
Trendsetter/-in

Change HubSpot automatic messages strings on membership pages

lösung

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
Mitglied

Change HubSpot automatic messages strings on membership pages

lösung

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
Trendsetter/-in

Change HubSpot automatic messages strings on membership pages

lösung

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/-in
Community-Manager/-in

Change HubSpot automatic messages strings on membership pages

lösung

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