Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 11 years ago

Last modified 8 years ago

#4631 closed defect (bug) (fixed)

Translation string "%s Directory" isn't good

Reported by: danieljuhl's profile DanielJuhl Owned by: boonebgorges's profile boonebgorges
Milestone: 2.0 Priority: normal
Severity: normal Version: 1.6.1
Component: I18N Keywords: has-patch 2nd-opinion
Cc:

Description

http://buddypress.trac.wordpress.org/browser/trunk/bp-core/bp-core-filters.php#L386
http://buddypress.trac.wordpress.org/browser/trunk/bp-core/bp-core-filters.php#L388

"%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 11 years ago.
4631.02.patch (6.5 KB) - added by boonebgorges 11 years ago.

Download all attachments as: .zip

Change History (14)

#1 @DJPaul
12 years ago

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

#2 @johnjamesjacoby
12 years 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.

#3 @boonebgorges
12 years 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.

#4 follow-up: @boonebgorges
11 years 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.

@boonebgorges
11 years ago

#5 in reply to: ↑ 4 @DJPaul
11 years 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. https://buddypress.trac.wordpress.org/browser/trunk/bp-activity/bp-activity-screens.php#L434

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

#6 @boonebgorges
11 years 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

#7 @DJPaul
11 years ago

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

#8 @boonebgorges
11 years 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

#9 @mineo
10 years ago

two years and same issue? How can I translate this strings?
thx
1.BP Groups page
2.BP Activity page - is visible only if the user unlogged
3.1. Groups
3.2 Poedit
3.3 Groups
1.http://predajsvojpribeh.sk/wp-content/uploads/2015/03/sc1.png
2.http://predajsvojpribeh.sk/wp-content/uploads/2015/03/sc4.png
3.1 http://predajsvojpribeh.sk/wp-content/uploads/2015/03/groups.png
3.2 http://predajsvojpribeh.sk/wp-content/uploads/2015/03/Snímka-obrazovky-z-2015-03-12-095209.png
3.3 http://predajsvojpribeh.sk/wp-content/uploads/2015/03/sc2.png

#10 @boonebgorges
10 years ago

mineo - Your Poedit screenshot makes it look like your translation is out of date. It's possible that your language's translation is not fully up to date; check out https://translate.wordpress.org/projects/buddypress to learn more (and contribute missing translations).

#11 @mineo
10 years ago

Ok, thank you. Issue is resolved. Maybe it help all newbies like me:

Do not copy old tranlated .po file, when is update of theme or plugin!!'''

When are new strings in new .po file, we need to merge old and new .po file.
This is the right way :)
Here is tutorial:
http://www.marketpressthemes.com/blog/how-to-merge-two-po-files-using-poedit/

#12 @DJPaul
8 years ago

  • Component changed from Locale - i18n to I18N
Note: See TracTickets for help on using tickets.