Skip to:
Content
Pages
Categories
Search
Top
Bottom

How do you translate a component name in the SWA filter menu ?

  • Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    In bp-activity-templatetags.php, there is a function called bp_get_activity_filter_links who shows the SWA filter menu.

    I have a new comonent who appears in the menu list, but who’s not translated. The comp name is in the .po file and is translated on other part of the site. So the problem is somewhere else, maybe in the BP core ?

    I tried to add the component name in the above list, to “make sure”, but this didn’t work.

    bp-activity-templatetags.php:380

    /* Make sure all core internal component names are translatable */
    $translatable_component_names = array( __( 'profile', 'buddypress'), __( 'friends', 'buddypress' ), __( 'groups', 'buddypress' ), __( 'status', 'buddypress' ), __( 'blogs', 'buddypress' ) );
    $component_links[] = $before . '<a href="' . attribute_escape( $link ) . '">' . ucwords( __( $component_name, 'buddypress' ) ) . '</a>' . $after;

    Thank you for ideas or help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Part of the problem could be that the textdomain is set to ‘buddypress’ for all links in the filters.

    ucwords( __( $component_name, 'buddypress' ) )

    ..so if your plugin uses its own textdomain everywhere AND needs to tap into this list, it will need to use the ‘buddypress’ textdomain somewhere too.

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    JJJ, your tip is not working for now.

    I changed the textdomain in my comp but didn’t work.

    I just added the component name into my .po file. and this is working without touching the bp-activity-templatetags file.

    But this is not a good solution.

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

You must be logged in to reply to this topic.