Skip to:
Content
Pages
Categories
Search
Top
Bottom

Does BuddyPress Have Modifiable (non-Translation) Language Files?

  • Avatar of 3sixty
    3sixty
    Participant

    @3sixty

    Is it possible to create a translation-like language file to help tweak BuddyPress language throughout the core?

    In customizing BuddyPress, I keep hitting roadblocks related to language choices. In many places, it seems like it’s very difficult to change hard-coded language without registering a whole group of new functions and unregistering official BuddyPress ones.

    The most recent problem is that I could not change the default “Search anything…” without creating a customized bp_dtheme_ajax_querystring() function and a customized bp_directory_forums_search_form() It was impossible to simply make a cosmetic change on the search form because BP interprets “Search anything…” as an actual search string unless both of those functions are kept in sync with hard-coded language.

    The other problem I have now is customizing activity stream language, which apparently will require hand editing of multiple files distributed across the BuddyPress core. Each of these could require custom my_buddypress_functions() so I don’t lose my changes every time the core is updated.

    There should be a way to make language changes without creating a my_buddypress_function() and unregistering “official” buddypress functions every time you want to make a small change. If nothing else I’m a little worried about overhead of creating a large bp-custom.php file or theme functions.php file.

    The way some other community/forum packages solve this is to create a language file that you can customize according to your needs, either through an admin panel or by directly editing the language.php file. I’m wondering if this has ever been discussed. I see the “Translation” sticky is no longer sticky and I wonder if that thread contained a similar idea. Can anybody weigh in on translation and how this works with BP? Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of 3sixty
    3sixty
    Participant

    @3sixty

    I guess I should have started here:

    http://buddypress.org/forums/tags/translation

    OK, so I found buddypress.pot – can anyone explain how to work with .pot files? Can I just edit this and the changes will magically appear in my theme?

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Read this:

    http://codex.buddypress.org/how-to-guides/customizing-labels-messages-and-urls/

    Use a program like PoEdit to edit language files.

    Avatar of 3sixty
    3sixty
    Participant

    @3sixty

    Sorry I missed this. I’ll review that and see if I can contribute any meaningful new pointers to the codex .

    Avatar of Miko
    Miko
    Participant

    @mikosoft

    I followed those instructions but it’s not clear to me what to put in the bp-custom.php file. Let’s say I name my translation buddypress2.po (and I have the corresponding buddypress2.mo). Where do I put “buddypress2″ in the code:
    `define( ‘BPLANG’, ‘mysite’ );
    if ( file_exists( WP_PLUGIN_DIR . ‘/buddypress-’ . BPLANG . ‘.mo’ ) ) {
    load_textdomain( ‘buddypress’, WP_PLUGIN_DIR . ‘/buddypress-’ . BPLANG . ‘.mo’ );
    }
    `
    Also, am I meant to put buddypres2.po and .mo into the folder /plugins/ or the folder /plugins/buddypress/ ? The article is unclear about that.

    Avatar of Miko
    Miko
    Participant

    @mikosoft

    Never mind, I figured it out. I re-read the intro and it says that the new .po and .mo files should have the format buddypress-mysite.po so I now changed that and placed all 3 files (.po .mo and bp-custom.php) into the root /plugins/ folder and all is working like a charm.

    measure twice, cut once as they say!

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

You must be logged in to reply to this topic.