Skip to:
Content

BuddyPress.org

Opened 16 years ago

Closed 16 years ago

Last modified 8 years ago

#397 closed enhancement (no action required)

Translation breaks display of widgets

Reported by: martinnr5's profile martinnr5 Owned by:
Milestone: Priority: major
Severity: Version:
Component: Keywords: translation, widgets
Cc: mburp

Description

Translating "Recent Blog Posts" results in that widget not being shown. The same is true for "Site Wide Activity". Perhaps this is also true for other widgets but I haven't gotten to them yet.

It doesn't matter if I translate them to something simple as "abc123", they still disappear.

If I "translate" them to exactly the same as the original string the widgets work as intended.

Change History (8)

#1 @martinnr5
16 years ago

I have now confirmed that this is true for all widgets (I'm using).

#2 @mburp
16 years ago

I'm having the same problem with a Hungarian translation. With regard to the 'Members' widget, it seems that translating strings in the body of the widget, such as 'Newest', 'Active', 'Popular', doesn't cause a problem. It seems its just the text that appears in the widget's header that's problematic.

#3 @apeatling
16 years ago

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

Unfortunately this is due to the way that widgets are registered.

The way to do it is this:

Remove all widgets that you are using BEFORE you translate.

Once you have turned on the translation to your language, THEN add the widgets to your page.

If you translate after adding widgets before you translate, they will be removed as the name in which they are registered is changed.

#4 @mburp
16 years ago

  • Milestone set to Core 1.0
  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Type changed from defect to task

First Andy, I love the idea of BuddyPress and have been eagerly awaiting a production release. My thanks to you and your collaborators in this project for all your work and for the gift of this new Mu add-on.

With regard to the current problem, WordPress Mu functions differently with regard to translations of widget header titles and these problems do not arise. The difference in coding appears minor to me.

I have altered bp-core-widgets.php lines 7 through 9 as follows:

from:

/* Site welcome widget */
register_sidebar_widget( __('Welcome', 'buddypress'), 'bp_core_widget_welcome');
register_widget_control( __('Welcome', 'buddypress'), 'bp_core_widget_welcome_control' );

to:

/* Site welcome widget */
register_sidebar_widget( Welcome, __('Welcome', 'buddypress'), 'bp_core_widget_welcome');
register_widget_control( Welcome, __('Welcome', 'buddypress'), 'bp_core_widget_welcome_control' );

This parallels the coding in WordPressMu's wp-includes/widgets.php, as on lines 1402 and 1403:

wp_register_sidebar_widget('pages', __('Pages'), 'wp_widget_pages', $widget_ops);
wp_register_widget_control('pages', __('Pages'), 'wp_widget_pages_control' );

I've also made this change for the 'Members' and 'Who's Online' widgets in bp-core-widgets.php. Handling the apostrophe in 'Who's Online' raises a problem; I've entered it as whos_online in the first position, although you'll know better than I if this was the best choice.

Translating the header text in the .po file with the widget already activated no longer causes the widget to disappear and the widget is still configurable in the admin pages.

Am I missing something, or could this simple change work for BuddyPress?

Thanks,

Michael
mburp

#5 @mburp
16 years ago

  • Cc mburp added

#6 @mburp
16 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

Please ignore my previous post - it didn't work after all.

#7 @(none)
15 years ago

  • Milestone Core 1.0 deleted

Milestone Core 1.0 deleted

#8 @DJPaul
8 years ago

  • Type changed from task to enhancement
Note: See TracTickets for help on using tickets.