Hi there,
i still have problems with translation my website. The registration form is the problem. I added several registration fields in s2member but have problems to translate them in different languages. I use the s2Member-Pro-Stripe-Form register=“1” to show the registration process.
I learned that the problem is, that the labels and options are used in plain text and doesn’t get localized. I found a very helpful thread: https://www.s2member.com/forums/topic/translation-of-custom-registration-fields/index.html
The trick is to hook in the registration process and replace the labels with localized labels. But still i have no success in doing so.
I added the following to my theme’s functions.php:
add_action("ws_plugin__s2member_during_configure_user_registration", "translate_custom_field");
add_action("ws_plugin__s2member_during_profile_during_fields_during_custom_fields_before", "translate_custom_field");
function translate_custom_field($rec)
{
// labels
$label = $rec['field']['label'];
$rec['field']['label'] = 'test';
$label = $rec['field']['sectitle'];
$rec['field']['sectitle'] = 'test';
return $rec;
}
The idea is that every label and sectitle should be ‘test’ after that. But nothing changed.
What am i missing? Do i need anything else to make the hook work? Obviously the translate_custom_field-function is never executed.
Hope that anybody has an idea for me.