Support » Plugin: WP-Members: Membership Framework » Translate options for checkboxes and dropdown

  • Resolved emcyze



    I have just upgraded to WP-members 2.9 and THANKS for the improvements.

    I have successfuly integrated WPML with this version for translating field labels.

    Although, option values for checkboxes and dropdown do not show translated..

    Any idea what i am doing wrong?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chad Butler


    Part of the intent with this release was to move the translation strings toward better WPML integration. It might take one or two more releases during the 2.9 release cycle to get everything right, though.

    So, I do see where we can add a translation string for the dropdown. I think if you change line 82 in utilities.php (in the wpmem_create_formfield function) from this:

    $str = $str . "<option value=\"$pieces[1]\"" . wpmem_selected( $pieces[1], $valtochk, 'select' ) . ">$pieces[0]</option>\n";

    to this:

    $str = $str . "<option value=\"$pieces[1]\"" . wpmem_selected( $pieces[1], $valtochk, 'select' ) . ">" . __( $pieces[0], 'wp-members' ) . "</option>\n";

    That would allow you to translate what displays to the user in the dropdown.

    But I don’t think you’ll want to change the option values of either checkboxes or dropdowns. These are the values if the option is selected and they need to be compared against a value to determine if they are checked or selected. If that value is translated, that process may not work correctly.

    Thanks Chad,

    It’s a perfect solution.

    It feels like WPML and Wpmembers are going to tie the knot 😉

    Thanks again and
    Best regards,

    Forgot to close the ticket.
    It solved the issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Translate options for checkboxes and dropdown’ is closed to new replies.