BuddyDev

Search

[Resolved] Translating Moderation Messages

  • Participant
    Level: Enlightened
    Posts: 34
    Casper on #52594

    Hi, just a quick question, I’m using both Buddypress Moderation Tools and Buddypress Profile Data Moderator. I needed to change both of the Moderation messages to direct users to a membership upgrade page. For Buddypress Moderation Tools (for the activity section) I translated from: “In moderation” to: “We need you to < a href=”// siteurl/ site-url /”” > Content Message For URL < /a > end content” Note: I separated the URL for display purposes and edited the content for privacy purposes, so please disregard the peculiar formatting above. Anyway, the point is, when that message is displayed in the “Activity” section, the portion in the brackets: “Content Message For URL” is a clickable link that goes to (in this example) siteurl / site-url . com. So that all works perfectly. The issue is, when I do the same for BuddyPress Profile Data Moderator, I use the same formula as above with the brackets/url/display content message, except it doesn’t produce a clickable link as it does in the first example. The formatting is exactly the same, and furthermore, in the front-end display, the “content message for URL” actually changes color (From red to blue), so it seems like something is happening, but the actual text isn’t a clickable link. With this in mind, do you know why in the second example with the data profile moderator isn’t working with the clickable link, and what could be done to make that link clickable? Any further insight/information and potential solution would be greatly appreciated. Thank you!

    Also, I’m not sure if this would be helpful or not, but I asked the question to chatgpt and got this response:

    Thanks for the detailed explanation. It sounds like the issue you’re experiencing might be related to how the HTML tags are being handled or interpreted in different contexts within the BuddyPress Profile Data Moderator plugin.
    Here are a few things you might want to check or try:
    HTML Encoding: Ensure that the HTML tags are properly encoded in the translation string. Sometimes, if the HTML tags are not correctly encoded, they might not render as expected, leading to the link not being clickable.

    Context: Verify that the context in which the translation is being displayed allows for HTML links. Some plugins or themes might sanitize or strip HTML tags in certain contexts for security or styling reasons.

    Plugin Compatibility: Check if the BuddyPress Profile Data Moderator plugin is fully compatible with HTML links in translated strings. It’s possible that the plugin might not handle HTML links in translations the same way as other plugins do.

    Debugging: If possible, try debugging the issue by inspecting the HTML output of the translated string in the user’s profile edit section. This can help identify if the HTML tags are being stripped or if there are any errors in the rendered HTML.

    Plugin Support: Consider reaching out to the developers of the BuddyPress Profile Data Moderator plugin for assistance. They might be able to provide insights into how translations are handled within their plugin and offer solutions or workarounds for making HTML links clickable in translated strings.

    By checking these points and possibly experimenting with different approaches, you may be able to resolve the issue and make the “Select a Membership” link clickable in the user’s profile edit section. Let me know if you need further assistance with any of these steps!

    I’m not sure exactly if that’s on the right track or not but I figured I’d at least mention it here to potentially assist with the troubleshooting and potential solution. Anyway, thank you again for your assistance and I look forward to your reply!

  • Keymaster
    (BuddyDev Team)
    Posts: 24611
    Brajesh Singh on #52596

    Hi Casper,
    Thank you for using the plugin.

    This is most probably related to how the message is shown. In profile moderator, we are probably using BuddyPress’s notice feature which is not allowing html.

    Please allow me to check and get back to you in next 24 hours.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 34
    Casper on #52599
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24611
    Brajesh Singh on #52621

    Hi Casper,
    Thank you for your patience.
    I am sorry, I was not sure which message you were referring to.

    I believe I understand it now. Is it about approval/rejection email message content?

    Please confirm and we will update it quickly.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 34
    Casper on #52682
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24611
    Brajesh Singh on #52696

    Hi Casper,
    The above code works fine in BuddyPress.
    It seems your theme is being over-protective and escaping the notices added by bp_core_add_message

    I tested it in BP Nouveau as well as BP Legacy with TwentyTwenty Two theme and it worked. Please check with your theme authors for the same.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 34
    Casper on #52723
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24611
    Brajesh Singh on #52727
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 34
    Casper on #52733
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24611
    Brajesh Singh on #52751

    You are welcome

The topic ‘ [Resolved] Translating Moderation Messages’ is closed to new replies.

This topic is: resolved