BuddyDev

Search

[Resolved] How to translate Custom User Profile Tabs label and content using WPML

  • Keymaster
    (BuddyDev Team)
    Posts: 24237
    Brajesh Singh on #51179

    Hi Caleb,
    Hope you are doing well.
    I am sorry, I could not assist earlier.

    I was not sure of the right way to solve it.

    I have two ideas which can be easily applied. I am writing these down here:-

    1. We create duplicate tabs(entries) for each language and associate a language from the right side scope drop down. That will allow us to support any number of language in future.
    The shortcoming of this approach is having duplicate tabs with same content. It can be mitigated by providing a duplicate button/link with each tab.

    2. Or we add only duplicate labels. It will be for a fixed set of languages and will solve your issue but is not maintainable for future.

    I am inclined towards approach 1, will that work for you?

    Please let me know and I will have it in next 12-24 hours from your reply.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 8
    Caleb Weeks on #51188

    Hi Brajesh,

    Option #1 sounds great! I like the idea of doing something that can be sustained in the future.

    Does that help?

    Thank you for working on a solution for this! It means a lot!

    I’ll await any code you are able to provide and will be ready to apply it right away.

    Thank you so much, Brajesh!

  • Keymaster
    (BuddyDev Team)
    Posts: 24237
    Brajesh Singh on #51208

    Hi,
    Thank you.

    Please upgrade to 1.4.1 and put this in your bp-custom.php

    
    // enable multilingual tab support.
    // it allows associating a tab to a wpml language.
    add_filter( 'bpptc_enable_wpml_support', '__return_true' );
    
    

    It will show a “Scope: Language” section on the right side of tab creation/edit page.

    If you do not select a language for a tab, It will apply to all languages. If you select a language, It will be scoped to that language.

    I lack access to WPML and used their API. Have tested with the dummy data but I am unable to verify if it works or not. Please give it a try and let me know.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 8
    Caleb Weeks on #51212
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24237
    Brajesh Singh on #51215
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 8
    Caleb Weeks on #51416

    Hello Brajesh!

    Happy New Year! 🥳

    I just wanted to let you know that this custom code you developed worked INCREDIBLY well! I think you nailed it! In fact, I am so encouraged and grateful that I think you created a way for BuddyDev’s Custom User Profile Tabs to be compatible (in a way) with WPML! To me, I can see how some might argue that this integration is a bit of “workaround” from the typical way WPML presents data, but I think the way you developed/delivered it is so easy and excellent that I would consider this absolutely usable/compatible!

    I just wanted to say, “Thank you!” so much again, and truly, if there is any way I can send you some more dollars to encourage your work or to perhaps write a review, I would be so glad to. Just let me know.

    Thank you, Brajesh! I hope you are doing well! 😊

  • Keymaster
    (BuddyDev Team)
    Posts: 24237
    Brajesh Singh on #51426

    Hi Caleb,
    Happy New Year!
    I hope you are doing well!

    I sincerely appreciate your kind words! I am glad It worked for your purpose!

    Though it is not something I am proud of due to usability concerns, it allowed us to achieve the goal with minimal changes. I am glad you were able to use it.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved