BuddyDev

Search

[Resolved] WPML BuddyPress User Profile Completion

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #21571

    Hi Han,
    Thank you for using the plugin.

    I don’t see any reason for conflict other than an issue related to feedback message.
    There is a possibility that the feedback message may not be language specific. Are you seeing this issue?

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Han on #21572

    Hi Brajesh, if you mean by feedback message the messages that are shown when profile is not completed. Then yes. Those messages are not translated. One of them is “Please upload your profile photo”.

    I now fixed it by using php shortcode snippets.

    Best, Han

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #21584

    Thank you Han.
    I am glad you have fixed it.

    The strings won’t translate as you can set them from the settings and those settings are not prepared for multilingual site(more than 1 language).

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 4
    Gilles Deron on #25954

    Hello Han,

    I am testing BuddyPress Profile Completion and I have the same issue: the messages for the users are not translated even if WPML is activated.

    I see that you fix it with PHP code snippets.

    Could you share your solution?

    I think it could help many people.

    Best Regards

    Gilles

  • Participant
    Level: Initiated
    Posts: 10
    Han on #25955

    Hi Gilles, i used the plugin ‘XYZ PHP Code” https://wordpress.org/plugins/insert-php-code-snippet/
    This plugin will make shortcode of the snippets. Those shortcodes you can enter in the fields on the settings page of the ‘BuddyPress Profile Completion’ plugin.

    snippet made in the XYZ PHP Code’ plugin, in my case English and Dutch:

    *** profile-completion-required-fields-message

    <?php
    if ( ICL_LANGUAGE_CODE=='en' )
    	{
    echo '<a href="https://yourwebsite.com/members/' . bp_core_get_username( get_current_user_id() ) . '/profile/edit/" style="color:#32a0ff">Your text EN</a>';
    }
    elseif ( ICL_LANGUAGE_CODE=='nl' )
    {
    echo '<a href="https://yourwebsite.com/nl/members/' . bp_core_get_username( get_current_user_id() ) . '/profile/edit/" style="color:#32a0ff">Your text NL</a>';
    	}

    *** profile-completion-profile-photo-message

    <?php
    if ( ICL_LANGUAGE_CODE=='en' )
    	{			
    echo "Your text EN";
    	}
    elseif ( ICL_LANGUAGE_CODE=='nl' )
    {
    echo "Your text NL";
    
    	}

    ***profile-completion-cover-photo-message

    <?php
    if ( ICL_LANGUAGE_CODE=='en' )
    	{			
    echo "Your text EN";
    	}
    elseif ( ICL_LANGUAGE_CODE=='nl' )
    {
    echo "Your text NL";
    
    	}
  • Participant
    Level: Initiated
    Posts: 4
    Gilles Deron on #25956

    Hello Han,

    Thanks a lot for your code, this will be very helpfull.

    Best regards,

    Gilles

  • Participant
    Level: Initiated
    Posts: 4
    Gilles Deron on #25969

    Hello,

    The php code here above permit to translate the error messages but do not keep the style of the original messages.
    In my case, with only BP Profile Completion, the messages are displayed in a large box, with red colored background and white text. Excellent for a error message.

    But with the PHP code snippets, the error messages are displayed in grey text with no background, so we have no highlight of the message.

    Is there a way to permit translation without the loss of style?

    Best regards

  • Participant
    Level: Initiated
    Posts: 4
    Gilles Deron on #25970

    Hello again,

    A ‘simple’ WPML compatibility will be great and helpfull.

  • Participant
    Level: Initiated
    Posts: 10
    Han on #25971

    you could style the css of the error message a bit

    #buddypress div#message.error p {
        color: #32a0ff!important;
        border-radius: 0;
        background: white!important;
        border-width: 1px!important;
        border-color: #32a0ff;
        font-size: 15px;
        font-weight: bold!important;
        text-align: center;
        border: 1px solid #32a0ff!important;
    }

You must be logged in to reply to this topic.

This topic is: resolved