Skip to:

Opened 18 months ago

Closed 6 weeks ago

#4631 closed defect (bug) (fixed)

Translation string "%s Directory" isn't good

Reported by: DanielJuhl Owned by: boonebgorges
Milestone: 2.0 Priority: normal
Severity: normal Version: 1.6.1
Component: i18n Keywords: has-patch 2nd-opinion


"%s Directory" is used to make page titles like "Activity Directory", "Groups Directory" and "Members Directory" etc.,

The issue is that in danish "User Groups" would be "Brugergrupper" and "Members" would be "Medlemmer", but "User Groups Directory" would be "Brugergruppeoversigt" (or maybe just "Gruppeoversigt") and "Members Directory" would be "Medlemsoversigt".

It would be better to use the same strings/translations for the page title as the headline eg. "Groups Directory" and "Members Directory".

Attachments (2)

4631.patch (2.1 KB) - added by boonebgorges 5 months ago.
4631.02.patch (6.5 KB) - added by boonebgorges 6 weeks ago.

Download all attachments as: .zip

Change History (10)

comment:1 DJPaul18 months ago

  • Component changed from Core to i18n
  • Milestone changed from Awaiting Review to 1.7

comment:2 johnjamesjacoby17 months ago

  • Milestone changed from 1.7 to 1.8

Punting to 1.8. We've gone back and forth about these in almost every release.

comment:3 boonebgorges11 months ago

  • Milestone changed from 1.8 to 1.9

I think the solution is each component with a directory title should be registering a 'directory_title' string in BP_Component::setup_globals() (we would generate one automatically as we currently do for components that don't do so), and then we'd use that directory_title string wherever we need to have a title for the component directory. Let's do this for 1.9.

comment:4 follow-up: boonebgorges5 months ago

  • Keywords has-patch added
  • Milestone changed from 1.9 to 2.0

4631.patch is an example of what I mean (for the activity component).

I'm moving this out of the milestone because there are some further odd problems with the page title filter. From what I can see, it's not actually working - it's getting cancelled out by some other filter on wp_page_title, so that eg the Members directory title is actually 'Members' rather than 'Members Directory'. We'll have to debug this before the current issue can be resolved.

boonebgorges5 months ago

comment:5 in reply to: ↑ 4 DJPaul6 weeks ago

  • Keywords has-patch removed

The page title filter is getting re-set by the calls to bp_theme_compat_reset_post() for each template, e.g.

And it is indeed different from the title element in the HTML that the web browser tab picks up.

comment:6 boonebgorges6 weeks ago

  • Keywords has-patch 2nd-opinion added

4631.02.patch is an updated patch that implements for Members, Activity, and Groups. It does change the current behavior by forcing the <title> element and the page title header element to be the same string. But to my mind, this is semantically correct anyway. And it's definitely a big translation improvement.

See also #4726

boonebgorges6 weeks ago

comment:7 DJPaul6 weeks ago

Approach seems decent. My only comment is I'd suggest using _x and providing context for this string __( 'Directory', 'buddypress' );.

comment:8 boonebgorges6 weeks ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 8090:

Improve strings used for <title> and header of directory pages

Our legacy method for creating directory titles involved concatenating the
component name into '% Directory', which did not work well in languages where
a term like 'Groups Directory' would be translated into a single word. In
addition, there was inconistency between the <title> element on directory pages
and the header element used in the page body.

This changeset introduces a 'directory_title' parameter to BP_Core_Component,
so that directories can register a fully localizable string as the title/
header for directories.

To avoid filter name conflicts, the filter names associated with the headers
on group and blog directory pages were changed to _directory_header. See r7942,

See #4726, #4630

Fixes #4631

Note: See TracTickets for help on using tickets.