Translations

Via the Translations tab of the form builder, you can add multiple translations to the same form. In the field Default Locale you specify which language key you want to use. In the field Translations JSON you can list the different translation keys via JSON code. Depending on the selected langauge, the JSON code will find and replace every translation key in your form.

To get started you can copy the example code below and use the editor of jsoneditorlinline.org to update your code.

{“en”:{“Yes”:”Yes”,”Submit”:”Submit”}, “sp”:{“Yes”:”Si”,”Submit”:”Enviar”}, “de”:{“Yes”:”Ja”,”Submit”:”Einsenden”}}

Share URL in a specific language

To set the language in a share URL, append the URL with the attribute lang.

  • Example 1: https://f.momentumtools.io/?form=ahhhilrxyjmq&lang=de
  • Example 2: https://f.momentumtools.io/?form=ahhhilrxyjmq&lang=fr

Embed a form in a specific language

To select the language in the embedded code, you need to assign a value to the attribute data-lang.

 

Translate Error messages

Translations for error messages are handled on a different way. Here is an example:

{“de”: {“required”: “{{field}} ist erforderlich”}}

Given a field with label “Name”, the error validation message will show: “Name ist erforderlich”. 

Below are a list of used translation strings:

“error” : “Please fix the following errors before submitting.” “invalid_date” :”{{field}} is not a valid date.” “invalid_email” : “{{field}} must be a valid email.” “invalid_regex” : “{{field}} does not match the pattern {{regex}}.” “mask” : “{{field}} does not match the mask.” “max” : “{{field}} cannot be greater than {{max}}.” “maxLength” : “{{field}} must be shorter than {{length}} characters.” “min” : “{{field}} cannot be less than {{min}}.” “minLength” : “{{field}} must be longer than {{length}} characters.” “next” : “Next”, “pattern” : “{{field}} does not match the pattern {{pattern}}” “previous” : “Previous” “required” : “{{field}} is required”}

Was this article helpful?

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *