APIs & Integrations

tarasmatrac
Membro

Add custom translations for all texts used in a form

Hi All,

I'm interested if it's possible to build a proper localized form for a custom language which is not in the supported list.
I see that you have something useful here https://developers.hubspot.com/docs/methods/forms/advanced_form_options
But I didn't find how to add custom translations for legends (help texts) and for general error messages like "Please complete all required fields."

I know about this https://knowledge.hubspot.com/articles/kcs_article/forms/create-form-in-multiple-languages but it's not desired solution and I need to translate a default support form that doesn't have such option available. If we talk about how to split support tickets from different locales then I'd like to use a separate field as locale.

Thanks. 

0 Avaliação positiva
1 Resposta 1
Derek_Gervais
Alunos da HubSpot
Alunos da HubSpot

Add custom translations for all texts used in a form

Hey @tarasmatrac ,

 

The translation configuration options detailed in the "How to customize the form embed code" articles should function for a support form, as well as regular forms. You can add a custom locale like this:

<script>
hbspt.forms.create({
    portalId: "xxxxxxx",
    formId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    locale: 'test',
    translations: {
        test: {
            required: "Hey! That's required!",
            invalidDate: "Please enter a real date",
            submitText: "Custom Submit Button Text",
            fieldLabels: {
                email: "Electronic mail"
            }
        }
    }
});
</script>
0 Avaliação positiva