Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How can I change the text ”Visit Blog” to somthing other like ”Visit Post” or ”Watch News


  • hozefasmile2007
    Participant

    @hozefasmile2007

    Hi I want to change the text That appear on pages for members/admin/blogs/ in buddypress.
    Generally on these pages a list of blogs are shown and there is a button on right side in which a “Visit Blog” is written.
    I Want to change the html of this link , means the text appear in this link to something “Visit Post” or “Watch this News”.

    How can we achieve this? I have searched lots of the file in buddypress and even wordpress. But didn’t get any solution. Is there anybody who can help me to find the file where the html settings for this is available or any other way to achieve this?

    Thanks In Advance
    Hozefa

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

  • hozefasmile2007
    Participant

    @hozefasmile2007

    Hay anybody never gone in a need to change these text ? W always doesn’t want it to be displayed as “Visit Blog” If its a news site it must be Visit News or something like that


    aces
    Participant

    @aces

    I think I may have just found a way – I saved the following as a plugin myself and it works. So If you change the Case text for your own it may help – I run single site so i can’t try it out…
    `<?php
    /*
    Plugin Name: Text Mangle
    Original Author URI: http://quirm.net/
    Description: Replacing buddypress texts the eshop plugin way.
    Based on PJW Translation Mangler by Peter Westwood http://blog.ftwr.co.uk/
    Originally cut and pasted from: http://quirm.net/wiki/eshop/changing-displayed-text/
    Author: Rich Pedley
    Version: 0.01
    */
    class buddypress_Translation_Mangler {
    /*
    * Filter the translation string before it is displayed.
    */
    function filter_gettext($translation, $text, $domain) {
    $translations = &get_translations_for_domain( ‘buddypress’ );
    switch($text){
    case “Who’s Online Avatars”:
    return $translations->translate( “Who’s Online…” );
    break;
    }
    return $translation;
    }
    }
    add_filter(‘gettext’, array(‘buddypress_Translation_Mangler’, ‘filter_gettext’), 10, 4);
    ?>`
    I would like to know if there’s anything wrong with using this technique in buddypress?


    @mercime
    Keymaster

    @mercime

    Yup, use the same thing myself

    Mangling strings for fun and profit


    kenrichman
    Participant

    @kenrichman

    Thanks for the links guys. I will try your suggestions.
    I am new to this but I can’t believe this is such a pain to do.
    Strings are constants – a type of data. Code is code. Why mix the two?
    I am an ex-programmer from the 80’s – back then, it was easy to make changes to string constants, or any type of constant, throughout a project – you kept them separate. If you didn’t you’d soon be in trouble.
    Some goes for colours, all sprinkled throughout. What a mess. What’s worse they’re in hexadecimal.
    It’s crazy.


    kenrichman
    Participant

    @kenrichman

    Progress!
    Using Text Mangle as a plug-in, I’ve changed various strings to what I want them to be, but unfortunately not all. For instance the tab that shows the number of friends e.g. Friends (2)
    I guess because the string has a variable part, it doesn’t match simply using the Text Mangle plugin code above.
    Any more help very gratefully received.


    aces
    Participant

    @aces

    @kenrichman

    Have you tried?
    `
    case “Friends (%d)“:
    return $translations->translate( “Mates (%d)” );
    break;
    `
    Also. I have just discovered from the buddypress codex that the friends slug can be changed to match to your choice…
    `
    define ( ‘BP_FRIENDS_SLUG’, ‘peeps’ );
    `
    It goes in the wp-config.php file


    kenrichman
    Participant

    @kenrichman

    All sorted …!
    I created a new language file – worth doing because I could fix up all the American spellings (well, there are one or two) to UK and customse various messages to make them nicer.

    This link in the codex was a great help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] How can I change the text ”Visit Blog” to somthing other like ”Visit Post” or ”Watch News’ is closed to new replies.
Skip to toolbar