• Creator
    Topic
  • #31241
    justdoit123
    Participant

    below is my MB custom meta for User, i just want to have a form for user to update their account info wordpress.

    i paste this code to functions.php, already show up.

    But i cannot translate it, it cannot translate, other MB custom field can be translated normally, not this one:

    add_filter( 'rwmb_meta_boxes', 'account_info' );
    
    function account_info( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'  => __( 'Email - Account Password', 'text-domain' ),
            'id'     => 'account-info',
            'type'   => 'user',
            'fields' => [
                [
                    'name' => __( 'Email', 'text-domain' ),
                    'id'   => $prefix . 'user_email',
                    'type' => 'email',
                    'desc' => __( '', 'text-domain' ),
                ],
                [
                    'name'              => __( 'New Account Password', 'text-domain' ),
                    'id'                => $prefix . 'user_pass',
                    'type'              => 'password',
                    'label_description' => __( 'Account password, not password for encrypted message', 'text-domain' ),
                    'desc'              => __( 'Enter new password if you want to change', 'text-domain' ),
                    'placeholder'       => __( '', 'text-domain' ),
                ],
                [
                    'name' => __( 'Your nick name', 'text-domain' ),
                    'id'   => $prefix . 'display_name',
                    'type' => 'text',
                ],
            ],
        ];
    
        return $meta_boxes;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #31245
    Long Nguyen
    Moderator

    Hi,

    I do not see any issue when translating the field name to another language. You might need to change the text domain text-domain to your theme or plugin text domain.

    Screen record https://share.getcloudapp.com/mXuP8DAm
    (using WPML)

    #31247
    justdoit123
    Participant

    hi, yes, i already changed text-domain, i leave it as an example. Do you know any other reason why it cannot be translated ??

    only this custome MB cannot be translated

    #31249
    Long Nguyen
    Moderator

    Hi,

    I'm using WPML to translate the custom field label as well. What's the plugin that you use to translate it? Or there is a duplicate meta box with custom field labels.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.