Skip to:

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3731 closed defect (bug) (fixed)

Language of titles

Reported by: ruban-gt's profile RuBAN-GT Owned by:
Milestone: 1.5.2 Priority: normal
Severity: major Version:
Component: Core Keywords: has-patch
Cc: slava.abakumov@…


Versia Buddypress: 1.5.1-1.5.0
If you put non-English translation buddypress (I have a russian), the site titles (<title>) will not be translate. In itself, this localization is translation ... How do I fix this?

Attachments (1)

localize_titles.patch (1.4 KB) - added by slaFFik 13 years ago.

Download all attachments as: .zip

Change History (6)

#1 @RuBAN-GT
13 years ago

And so, I made corrections in analogy with 1.2 version of buddypress.
Fixes for 1.5:

$title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( bp_current_component() ) ) );


$title = strip_tags( sprintf( __( '%1$s &#124; %2$s', 'buddypress' ), $bp->displayed_user->fullname, __( ucwords( $bp->current_component ), 'buddypress' ) ) );

$title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[$bp->current_item][$bp->current_action]['name'], bp_get_name_from_root_slug( bp_get_root_slug() ) );


$title = sprintf( __( '%1$s &#124; %2$s &#124; %3$s', 'buddypress' ), __( bp_get_name_from_root_slug(), 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[$bp->current_component][$bp->current_action]['name'] );

$title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug( bp_members_slug() ) );
$title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug( bp_get_root_slug() ) );


$title = sprintf( __( '%s Directory', 'buddypress' ), __( ucwords( $bp->members->slug ), 'buddypress' ) ); 
$title = sprintf( __( '%s Directory', 'buddypress' ), __( bp_get_name_from_root_slug(), 'buddypress' ) );

#2 @boonebgorges
13 years ago

  • Milestone changed from Awaiting Review to 1.5.2

Thanks for the patches.

We shouldn't be putting dynamic content through the __() translation function. That function should only take hardcoded strings, as otherwise it will be impossible to create generic .pot files for translators. This means that your particular suggestions won't work (eg, __( bp_get_name_from_root_slug(), 'buddypress' ))

That said, your third fix passes the value of bp_get_name_from_root_slug() to the translation function, which is possibly correct (since bp_get_name_from_root_slug() returns the component name, which is hardcoded into the component loader). I'll have to test.

I generally run the French translation and have not noticed any problems with these titles. No ya govaryu nemnozhko po russki, so I'll download the Russian translation pack sometime this week and see if I can reproduce your issues.

#3 @slaFFik
13 years ago

  • Cc slava.abakumov@… added
  • Keywords has-patch added

His 1st and 3rd suggestions work. I've tested it.
His 2nd suggestion is not needed. It's translatable.

Here is ru_RU for trunk:

Patch attached. Now all titles are translatable.

Last edited 13 years ago by slaFFik (previous) (diff)

#4 @boonebgorges
13 years ago

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

(In [5353]) Passes automatically generated <title>s through translation functions, so that they can be localized. Fixes #3731. Props RuBAN-GT, slaFFik

#5 @boonebgorges
13 years ago

(In [5354]) Passes automatically generated <title>s through translation functions, so that they can be localized. Fixes #3731. Props RuBAN-GT, slaFFik

Note: See TracTickets for help on using tickets.