-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message translations not working with craft.formie.renderForm #2163
Comments
What's your static translation string? Using the following is working for me:
|
I was using a copy of one of the translation files ( <?php
return [
//
// Email Messages
//
'formie_failed_notification_heading' => 'When an email notification fails to send:',
'formie_failed_notification_subject' => 'Email notification failed to send for form "{{ form.title }}" on {{ siteName }}.',
'formie_failed_notification_body' => "An email notification for the form “{{ form.title }}” has failed to send.\n\n" .
"The error response was recorded: {{ emailResponse | json_encode }}.\n\n" .
"To review it please log into your control panel.\n\n" .
"{{ submission.cpEditUrl }}",
'"{label}" should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '"{label}" should contain at most {max, number} {max, plural, one{character} other{characters}}.',
'(GDPR) {text}' => '(GDPR) {text}',
...
]; I assumed it included all the necessary translations for forms and planned to use it as a starting point. However, I noticed that the key After adding it, I can confirm that this key is translated correctly. Is there a registry of required translation keys? Or should I simply use another language file as a base (e.g., Thanks! |
Apologies for that missing from the English file! We automate adding strings to that file, so I'll see if there's just been a mishap to including it. That should certainly be the central registry of translations strings to work from. |
Yep, looks like a few were just plainly missed. |
Describe the bug
Describe the bug:
I'm using Formie 3.0.12 and attempting to translate messages for a form rendered with
{{ craft.formie.renderForm('donation') }}
.I created a translation file at
/translations/fr/formie.php
, containing all the keys fromvendor/verbb/formie/src/translations/en/formie.php
(following the documentation). However, these translations are not being applied to the error messages.Note: The Craft site’s language is configured as French (
fr
), and I have confirmed that other translations (e.g., for templates and fields) are working as expected.Expected behavior:
The error messages should be translated into French based on the keys in the
/translations/fr/formie.php
file.Actual behavior:
The messages remain in English, even though the corresponding French translations are defined in the translation file.
Steps to reproduce
{{ craft.formie.renderForm('donation') }}
formie.php
translation file.Form settings
Craft CMS version
5.5.3
Plugin version
3.0.12
Multi-site?
No
Additional context
No response
The text was updated successfully, but these errors were encountered: