Hi,
what file should I edit to allow me to translate validation messages, now currently 'default' and in english.
thanks,
James Tan
Hi,
what file should I edit to allow me to translate validation messages, now currently 'default' and in english.
thanks,
James Tan
You can change the individual validation errors for each field in the form builder, advanced tab:
http://www.gravityhelp.com/forums/topic/validation-error-languaje#post-15785
To change the message that shows at the top of the form ("There was a problem with your submission. Errors have been highlighted below.") you can use the gform_validation_message filter.
http://www.gravityhelp.com/documentation/page/Gform_validation_message
Any code using the gform_validation_message will be added to your theme's functions.php:
http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F
Hi Chris,
thanks a lot for the reply, I appreciate and already browse them. I need to find a way to e.g.
GF form input field for password for example, you know it can either be empty (ppl forget to fill it in), not enough strength etc. So how can I translate these individual exceptions from english to e.g. japanese? I got the Japanese strings ready, just am not sure where to put them in.
I can see Advanced -> Validation Message allows me only a single line so am supposed it's global for any exceptions for that input field. As you can see, this does not help me achieve above requirement.
Any help or lead to guide etc would be appreciated,
thanks,
James Tan
If you need to translate some strings that are used by the form itself such as the password strength related text you must do so by translating the POT file and making a localized language file for the plugin.
The POT file is located in the languages folder of Gravity Forms. This is the standard way to translate WordPress plugins. You can read more here:
http://weblogtoolscollection.com/archives/2007/08/27/localizing-a-wordpress-plugin-using-poedit/
Hi,
what if I just want to focus on the validation strings such as e.g.
For email input field:
a) "The email address can not be empty" - by leaving it null.
b) "Please enter a valid email address." - by typing any 'garbage'.
Where should I start looking at to translate these specific strings?
thanks!
James Tan
Those simple validation strings are set on the advanced tab of each field in the form builder as described here.
Try submitting a garbage email address here to see the custom error string I entered.
http://gravity.chrishajer.com/story-submission/
That doesn't even remotely look like a valid email!
I don't believe you have the option to have both a "missing required field" message and email validation error message. I have the feeling email is unique since it does some sanity checks to see if it at least looks like an email address.
I have a related question. I'm not trying to translate languages, but I do want to selectively change only one type of validation message, and not override all messages in the advanced tab. For example, I want to keep the default text for the message when an email address field is not a correctly formatted email address, but I do want to change the validation text for when the option for "No Duplicates" is checked, if the user enters a non-unique email.