0

The main message error could be translated through template code:

 {if form:has_errors}
            <div class="callout alert">
                There was an error submitting this form.. 
            </div>
 {/if}

But the input message error: This field is required could be translated only by translating 'This field is required' inside this file: system/user/addons/freeform_next/Library/Composer/Components/AbstractField.php

 $errors[] = $this->translate('This field is required');

enter image description here

So, how to translate the "This field is required" message error without to modify the AbstractField.php file ?

1 Answer 1

1

Translating in EE isn't the most robust, and as far as I understand, it has to be done with a translation file placed inside the add-on's language folder. You can just open up /system/user/addons/freeform_next/language/english/freeform_next_lang.php

Then copy and paste that into a folder with your language name at /system/user/addons/freeform_next/language/

And add lines like this:

'{email} is not a valid email address' => '{email} your translation here',
​'This field is required' => 'Your translation here',

​ If you wish, we can include any translations you provide us with in future releases of Freeform. :)

2
  • Thanks a lot for the fast reply and great solution. Problem solved ! I had a look to freeform_next_lang.php, but I did not think about this solution.
    – Stéphane
    Commented May 7, 2019 at 2:31
  • 1
    Sure, I will send you french and portuguese traduction!
    – Stéphane
    Commented May 7, 2019 at 2:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.