craftcms / contact-form

Add a simple contact form to your Craft CMS site.
https://plugins.craftcms.com/contact-form
MIT License
294 stars 93 forks source link

Added ability to translate the labels of the field keys in the generated content template. #161

Closed bertoost closed 2 years ago

bertoost commented 5 years ago

Keys are prefixed with contact_form., so you can define something like contact_form.name for the label in the site.php translations file. Also a check, if the translation doesn't exist, it returns the generated-key, then it falls back to the original key (as it was before).

bertoost commented 5 years ago

Also applied lcfirst() so keys like Email become contact_form.email instead, or contact_form.lastName etc.

brandonkelly commented 2 years ago

Added this for the next release.

It only applies to custom message keys rather than all keys (everything else can use the contact-form category already), and there’s no contact_form. prefix for the translation keys.