latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

translating Custom Registration/Profile Field

Home Forums Community Forum translating Custom Registration/Profile Field

This topic contains 7 replies, has 2 voices. Last updated by  Raam Dev 4 years, 3 months ago.

Topic Author Topic
Posted: Thursday Sep 6th, 2012 at 10:40 pm #24444
Frank Epton
Username: franclin

I’ve been having difficulty getting WPML to translate the Custom Registration/Profile Fields ( optional, for further customization ) I had posted earlier but the post was closed before I was able to get back to it.

From my conversation with WPML we think the issue has something to do with the short codes.

WPML:
When themes and plugins use get_option, they read values from the wp_options table. WPML can filter these calls and provide translation to the values of these options.

For this you can create a language configuration file, which tells WPML which Admin texts you want to translate.

http://wpml.org/documentation/support/language-configuration-files/

WPML:
Checking the code, I think the plugin author (s2member) have used shortcodes for displaying custom fields.
%%custom_fields%%

So we need to check the functions which give call to custom fields.

Can you please check the function call and paste here.

My question is: where do I find the function for the custom fields? Do I need it? am I going down the right rabbit hole?

FYI the original question was with regard to the PayPal pro form translation. All but the custom fields were showing up as translatable items. ie WPML could find the regular form titles (name, address, phone number) and allow us to link a translation to them but custom fields (such as “yes I want to receive monthly emails”) are not showing up.

Thanks for your help.

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Saturday Sep 8th, 2012 at 5:00 am #24598
Raam Dev
Username: Raam
Staff Member

Hi Frank,

Are you trying to translate the variables that you put in emails (e.g., %%custom_fields%%), the Custom Fields themselves when they show up on a Pro-Form, or something else? It’s not entirely clear to me what you’re trying to translate.

Also, have you seen front-end translations? Is that maybe what you’re looking for?

Posted: Monday Sep 17th, 2012 at 10:36 am #25569
Frank Epton
Username: franclin

Hi Raam, I have created a few new “Custom Registration/Profile Fields” for my membership form. For example, ‘yes I wish to receive the monthly news letter’

The form works perfectly but when I try to translate using WPML the Custom Fields are missing. The rest of the form does show up and I have been able to translate it. eg phone number, address etc

You can see more details on this thread: http://wpml.org/forums/topic/translation-for-s2member-forms/

I’m looking at the link you have sent and I’m not sure if it applies or not. I see that the thread pertains to changing text for a coupon but in the JavaScript I see “function s2_contextual_translation”

Can I assume I should to the following?

<

?php
add_filter("gettext_with_context", "s2_contextual_translation", 10, 3);
function s2_contextual_translation($translation = NULL, $original = NULL, $context = NULL)
    {
        if($context === "s2member-front" && $original === "Job Title")
            /* Here you provide the translation.
            You can take the `%s` Replacement Codes out if needed. */
            $translation = "titre d'emploi";
        /**/
        else if($context === "s2member-front" && $original === 'yes I wish to receive the monthly news letter')
            $translation = 'Oui, je souhaite recevoir la lettre mensuelle nouvelles';
        /**/
        return $translation;
    }
?>

If this is correct. Will my client be able to alter the translations with WPML for is this something that will always be custom? ie I will have to keep track of it outside the WPML interface.

Posted: Monday Sep 17th, 2012 at 10:41 am #25570
Frank Epton
Username: franclin

Here is the page I am working on. Everything under “additional Info” needs to be translated.

http://ccarts.ca/membership-application-form/individual-member-annual-billing/

Posted: Tuesday Sep 18th, 2012 at 1:35 am #25659
Raam Dev
Username: Raam
Staff Member

Hi Frank,

Yes, I believe that is correct. You’d need to update the contextual filters for Custom Registration Fields instead using WPML. However, I’m going to double-check with another support rep to make sure that’s the case.

Posted: Wednesday Sep 19th, 2012 at 6:19 am #25758
Raam Dev
Username: Raam
Staff Member

Hi Frank,

I confirmed that it’s not currently possible to make the Custom Registration Fields multilingual. However, if you need to translate them into only one language, you can simply enter the translated text when you create the Custom Registration Field in Dashboard -› s2Member® -› General Options -› Registration/Profile Fields.

Posted: Wednesday Sep 19th, 2012 at 10:19 am #25802
Frank Epton
Username: franclin

When you say

you can simply enter the translated text when you create the Custom Registration Field

do you mean that I can enter the English followed by the French in the “Field Label/Desc:”

for example
Field Label/Des”: “Bonjour/Hello”

This will look a bit odd since all of the other lines are translated. …But if that’s the only work around… what choice do I have.

Posted: Thursday Sep 20th, 2012 at 5:51 am #25892
Raam Dev
Username: Raam
Staff Member

Hi Frank,

Yes, I mean that you can enter the text directly into the description of the Custom Registration Field when you create it. If both languages are required, then you’d need to include both of them as your example shows above.

Viewing 7 replies - 1 through 7 (of 7 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.