On our site where we use Gravity Forms, we support three languages; French, English and Spanish.
I would like to know how to change the "first" and "last" labels of an advanced name field.
Currently I can change everything except this.
On our site where we use Gravity Forms, we support three languages; French, English and Spanish.
I would like to know how to change the "first" and "last" labels of an advanced name field.
Currently I can change everything except this.
You can do that with a filter.
http://www.gravityhelp.com/forums/topic/field-name-first-and-last#post-18600
Are you using any kind of translation plugin such as WPML? If not you should check out this add-on for WPML:
http://wpml.org/documentation/related-projects/gravity-forms-multilingual/
If you want to manually do it you can do so using custom PHP you add to your themes functions.php file. The sublabel hooks are documented here:
http://www.gravityhelp.com/documentation/page/Developer_Docs#Sublabels
@Kevin, I've tried to use the filter and I'm not having much success with this at all. I tried adding the functions to my functions.php
How do I differentiate between two forms on the site. One I want to keep in English, the two others I need to localise to French and Spanish (although they are the same form).
@Carl, I don't use a translation plugin. Ideally I'd like to code this inside Gravity so that I'm not dependent on future updates of another secondary plugin.
Are you trying to do this with one form?
You would have to have 3 different forms. Create one in English, the 2nd in French and the 3rd in Spanish.
The sublabel filters that Kevin provided a link for do work, so if they aren't working it's going to be due to how you implemented them. You differentiate which form you are targeting with those filters by appending the form id of the form you want to target to the filter call.
For instance this would apply the change globally to all forms:
add_filter("gform_name_first", "change_name_first", 10, 2);
function change_name_first($label, $form_id){
return "First Name";
}
And this would only apply the label change to ONLY Form ID 5:
Are you trying to do this with one form?
You would have to have 3 different forms. Create one in English, the 2nd in French and the 3rd in Spanish.
The sublabel filters that Kevin provided a link for do work, so if they aren't working it's going to be due to how you implemented them. You differentiate which form you are targeting with those filters by appending the form id of the form you want to target to the filter call.
For instance this would apply the change globally to all forms:
add_filter("gform_name_first_5", "change_name_first", 10, 2);
function change_name_first($label, $form_id){
return "First Name";
}
So you append the form id to the end of the filter (ex. gform_name_first_5).
If you can show us the code you are using we can take a look. You can copy-n-paste your code at http://www.pastie.org/ and provide the link here and we can take a look.
This makes sense, I'm dyslexic which puts me on bad footing to start with!
I didn't see the immediate difference between "gform_name_first" and "gform_name_first_5"
oy... going to add this now and will report back some success! hopefully...
Happy to report this is all working well! Thanks very much for the help.