• Resolved oshevans

    (@oshevans)


    UM version 2.2.4
    WPML version 4.4.12

    Using the default profile form with some custom checkbox and radio fields.
    UM page is translated (but using the same shortcode id)
    UM form is not translated
    Using WPML auto-register to find strings to translate

    Edit profile – all labels and values show translated strings – yay!
    View profile – all labels translated, but values show in default language… these should also be showing translated values as per the edit form.

    Any ideas?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter oshevans

    (@oshevans)

    Found the issue:

    includes/core/class-fields.php – ln 4197

    changed $res to __( $res,’ultimate-member’ )

    Now it translates the db value before presenting it (as per the edit field).

    This needs to be reported, so once I’ve finished my deadline for tomorrow, I’ll report it.

    Thread Starter oshevans

    (@oshevans)

    Here’s an interim solution that doesn’t involve editing core:

    add_filter( ‘um_view_field’, ‘my_view_field’, 10, 3 );
    function my_view_field( $output, $data, $type ) {
    if ($type === “checkbox”) {
    $values = explode(“, “, $output);
    for($i = 0; $i < count($values); ++$i) {
    $values[$i] = __( $values[$i], ‘ultimate-member’ );
    }
    $output = implode(‘, ‘, $values);
    } else {
    $output = __( $output, ‘ultimate-member’ );
    }
    return $output;
    }

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @oshevans

    Thanks for letting us know how you’ve resolved the issue.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Translated checkbox showing in profile edit but not profile view’ is closed to new replies.