Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to Customise Registration Messages that Survive BuddyPress Updates?


  • simon1970
    Participant

    @simon1970

    Hello,

    I need to change the default messages that are displayed when a user registers, and also keep the changes after BuddyPress updates. I have tried placing the register.php and activate.php template files into my child theme (my-child-theme\buddypress\bp-templates\bp-legacy\buddypress\members\register.php) but they don’t seem to work, the default messages are still displayed.

    How do I do this?

    Thanks!

    Simon

Viewing 10 replies - 1 through 10 (of 10 total)

  • Henry Wright
    Moderator

    @henrywright

    You can create a language file. Check out this article:

    Customizing Labels, Messages, and URLs


    simon1970
    Participant

    @simon1970

    Hi,

    Thanks for this info. I’m not sure what I am doing wrong but when I follow the instructions step-by-step in the article, nothing changes. The default “You have successfully created your account!” message appears after registration. I edited the .po file in DreamWeaver then (I believe) I created a .mo file using PoEdit and uploaded the two files to wp-content/languages/plugins but nothing changes. I say “I believe” because this is the only part I’m not 100% on. All I did was open the .po file in PoEdit and save it again. When I checked the folder there was a .mo file present, so I assumed it had worked, but perhaps it had not worked? I opened the .mo file in DreamWeaver and checked its contents. Here are the contents:

    Þ• $,8É9Project-Id-Version: BuddyPress 2.6.2
    Report-Msgid-Bugs-To: https://buddypress.trac.wordpress.org
    POT-Creation-Date: 2016-08-04 22:00:54+00:00
    MIME-Version: 1.0
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 8bit
    PO-Revision-Date: 2016-09-25 16:51-0700
    Last-Translator: JOHN JAMES JACOBY <jjj@buddypress.org>
    Language-Team: ENGLISH <jjj@buddypress.org>
    X-Generator: Poedit 1.8.8
    Plural-Forms: nplurals=2; plural=(n != 1);
    Language: en_US

    Is this correct or have I done something wrong?

    Thanks,

    Simon


    Henry Wright
    Moderator

    @henrywright

    You can open the .po file in Poedit and then do your editing. No need for Dreamweaver.

    Your .po and .mo files should be named based on your locale. So as an example, mine are:

    wp-content/languages/plugins/buddypress-en_GB.po
    wp-content/languages/plugins/buddypress-en_GB.mo

    EDIT: Do not use these paths; instead, see @danbps update below.


    danbp
    Participant

    @danbp

    hi Henry @henrywright,

    wp-content/languages/plugins/buddypress-en_GB.mo

    this path is the one used by GlotPress’s official automated translation updates for BP (and any other plugin translation if it exist). Same behave for the languages/themes/ directory.

    If you add a customized po/mo there, it will be overwritten at next update !

    Since i18n new improvements in WP 4.6, the only way to keep the integrity of a custom translation actually, so far i know, is to use this plugin: wpt-custom-mo-file, who allows you to override and use your own translation files for any WordPress themes or plugins.

    Just to let you know. 🙂


    Henry Wright
    Moderator

    @henrywright

    Thanks for the heads up @danbp! I’ve updated my post above 🙂


    simon1970
    Participant

    @simon1970

    Hi,

    For some reason all the above methods don’t work for me. I even tried uninstalling and re-installing PoEdit but no joy. Below is the .mo file that was automatically created using the above method. Note the translations are there but it all looks a bit messed up with nonsense at the start. Is this what an .mo file should look like?

    Þ• L|¨x©’”qµŒ’h´Ÿw½þ5þ4‚3‚¶Registering for this site is easy. Just fill in the fields below, and we’ll get a new account set up for you in no time.Thanks for registering!

    To complete the activation of your account, go to the following link: {{{activate.url}}}Thanks for registering!

    To complete the activation of your account, go to the following link: {{{activate.url}}}Your account was activated successfully! You can now log in with the username and password you provided when you signed up.Your account was activated successfully! Your account details have been sent to you in a separate email.Project-Id-Version: BuddyPress 2.6.2
    Report-Msgid-Bugs-To: https://buddypress.trac.wordpress.org
    POT-Creation-Date: 2016-09-26 13:45-0700
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    PO-Revision-Date: 2016-09-26 13:49-0700
    Language-Team: ENGLISH <jjj@buddypress.org>
    X-Generator: Poedit 1.8.9
    Last-Translator:
    Plural-Forms: nplurals=2; plural=(n != 1);
    Language: en_GB
    Registering for this site is easy! Just fill in the fields below and we’ll get a new account set up for you in no time!Thank you for registering with Skewen Angling Club!

    To continue, please verify your email address via the email we have just ”
    “sent to you.</br></br></br></br></br></br></br></br></br></br></br></br></”
    “br></br></br></br></br></br></br></br></br></br>Thank you for registering with Skewen Angling Club!

    To continue, please verify your email address via the email we have just ”
    “sent to you.</br></br></br></br></br></br></br></br></br></br></br></br></”
    “br></br></br></br></br></br></br></br></br></br>Thanks for verifying your email address! Once your account has been approved we will notify you via email with your login details.Thanks for verifying your email address! Once your account has been approved we will notify you via email with your login details.

    Thanks,

    Simon


    simon1970
    Participant

    @simon1970

    Hi,

    After multiple unsuccessful attempts to get this to work using PoEdit and the plugin mentioned above I am starting to think that it might be a theme issue. I am using BeTheme. If anyone has any knowledge of how .mo files work with BeTheme, please let me know as I am pulling my hair out here.

    Thanks,

    Simon


    simon1970
    Participant

    @simon1970

    Hi,

    Thanks for all your help. I still can’t get that method to work but I have found what I believe is a better (or at least an alternative) way to do this, using the bp-templates system. The bp-templates system was the method I had previously been trying to use but for some reason I couldn’t get it to work. It turns out I was using the wrong path for the templates in my child theme. The following article set me straight:

    https://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/

    The above article explains the correct path for the templates. The mistake I made was to include bp-templates\bp-legacy followed by \buddypress in the path in my child theme. I should not have included the bp-templates\bp-legacy part of the path and just started with buddypress instead. I hope that makes sense.

    Now I can make all my changes to the template files instead, and these changes won’t be affected by any updates.

    Thanks again,

    Simon


    Henry Wright
    Moderator

    @henrywright

    @simon1970 glad you got this working. You may at some point come across text in core files that you need to change. That’s where localisation comes in handy, but for now it looks like you’re sorted 🙂


    simon1970
    Participant

    @simon1970

    @henrywright Thanks, yes I would like to be able to use translation files and have tried in the past too but for some reason I can’t get them to work. I suspect it might have something to do with BeTheme as this theme has caused me lots of issues in the past. I will probably try to get to the bottom of it again sometime but for now I’m really glad I got the templates working anyway 🙂

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