Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing labels without localization


  • joshdrok
    Participant

    @joshdrok

    Is there any way to change the labels other than the PO and MO translation method? This way of changing the labels is shotty at best, and I have to change these every single time Buddypress is updated. Is there anyway I can change the “groups” label to a more fitting term for my site that is a little more permanent and stable? Is it possible to edit the plugin and achieve this?

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

  • danbp
    Moderator

    @danbp

    No, it’s the best way. And you can always selectively deactivate automated updates.


    ScotKinney
    Participant

    @scotkinney

    This should be documented in more detail. I’ve been trying to do it for 2 days now. PoEdit is difficult and undocumented. All I want to do is change the word Groups to Alliance everywhere it applies. Isn’t there a plugin or a tutorial that is complete anywhere?


    danbp
    Moderator

    @danbp

    They are so many topics on this forum explaining how to do this ! If you think it’s not correctly documented, add your contribution to the Codex.

    That said, i made you a working buddypress-en_US file you can download with almost(hopefully) all groups related strings changed to Alliance. Some are not modified, but you can add your own words with poEdit.

    https://make.wordpress.org/polyglots/handbook/tools/poedit/


    joshdrok
    Participant

    @joshdrok

    Yes there are plenty of tutorials out there on using localization to change the labels, but to be fair… This method isn’t 100% in my experience. I could get the labels changed in about 95% of my site. be sure to change the localizations in your theme file if you happen to be using a buddypress theme. I’m looking into other ways to achieve this without localization. I’ll report back here with my findings.


    Henry Wright
    Moderator

    @henrywright

    Hi @joshdrok

    An alternative way of changing text is to use the gettext filter. See this article for more info:

    https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext


    danbp
    Moderator

    @danbp

    @joshdrok, have you installed the po/mo i made for you ?


    @henrywright
    ‘s trick is a good alternative ONLY for a few strings (< 10). Using that filter force gettext to recalculate each string and slow down a site if it is used intensively. Use that with caution and only in the very rare case you have no other possibility.


    Henry Wright
    Moderator

    @henrywright

    Hi @danbp,

    Do you have any links to details about the gettext problem? I’m interested to learn more.


    danbp
    Moderator

    @danbp

    Hi @henrywright,

    it’s not exactly a problem ;-), more a pure php fact.

    As of WP Codex about gettext filter (codex.wordpress.org/Plugin_API/Filter_Reference/gettext)
    This filter hook is applied to the translated text by the internationalization functions (__(), _e(), etc.). IMPORTANT: This filter is always applied even if internationalization is not in effect, and if the text domain has not been loaded. If there are functions hooked to this filter, they will always run. This could lead to a performance problem.

    Some related articles:

    Introduction to the gettext Filter in WordPress

    The dangers of the gettext filter


    Henry Wright
    Moderator

    @henrywright

    @danbp thanks for these links! 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Changing labels without localization’ is closed to new replies.
Skip to toolbar