Skip to:
Content

bbPress.org

Opened 8 years ago

Closed 8 years ago

#2073 closed defect (fixed)

Menu labels are not translated

Reported by: toemon Owned by:
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.2
Component: Locale - i18n/l10n Keywords: needs-patch
Cc:

Description

Thank you for the great plug-in.

I am creating the Japanese language file for bbpress 2.2.2
However, the menu of bbPress in an Admin page is not translated.

In the debugger's test:
register_post_types() will be called before the load_textdomain().
Therefore, register_post_types() can't translate $post_type['labels' ] definitely.

Attachments (2)

admin_menu.png (171.8 KB) - added by toemon 8 years ago.
admin menu
admin_menu_result.png (59.4 KB) - added by toemon 8 years ago.

Download all attachments as: .zip

Change History (13)

#1 @toemon
8 years ago

  • Component changed from Actions/Filters to i18n/l10n

@toemon
8 years ago

admin menu

#2 @toemon
8 years ago

I made the following modifications as temporary measures.

Insert self::$instance->load_textdomain(); bbpress.php line 109

	public static function instance() {
		if ( ! isset( self::$instance ) ) {
			self::$instance = new bbPress;
			self::$instance->setup_globals();
			self::$instance->includes();
			self::$instance->load_textdomain();
			self::$instance->setup_actions();
		}
		return self::$instance;
	}

#3 @toemon
8 years ago

Action execution order is determined by the 72-82 line in the bbpress/includes/core/actions.php file.

/**
 * bbp_init - Attached to 'init' above
 *
 * Attach various initialization actions to the init action.
 * The load order helps to execute code at the correct time.
 *                                              v---Load order
 */
add_action( 'bbp_init', 'bbp_register',         0   );
add_action( 'bbp_init', 'bbp_load_textdomain',  10  );
add_action( 'bbp_init', 'bbp_add_rewrite_tags', 20  );
add_action( 'bbp_init', 'bbp_ready',            999 );

In this case, the priority of bbp_register is higher than bbp_load_textdomain.

#4 @toemon
8 years ago

  • Keywords reporter-feedback added

#5 @toemon
8 years ago

  • Keywords reporter-feedback removed

#6 @alexvorn2
8 years ago

dublicate #2047

#7 @toemon
8 years ago

Add tried of test:

original: bbpress/includes/core/actions.php

/**
 * bbp_init - Attached to 'init' above
 *
 * Attach various initialization actions to the init action.
 * The load order helps to execute code at the correct time.
 *                                              v---Load order
 */
add_action( 'bbp_init', 'bbp_register',         0   );
add_action( 'bbp_init', 'bbp_load_textdomain',  10  );
add_action( 'bbp_init', 'bbp_add_rewrite_tags', 20  );
add_action( 'bbp_init', 'bbp_ready',            999 );

modify: bbpress/includes/core/actions.php

/**
 * bbp_init - Attached to 'init' above
 *
 * Attach various initialization actions to the init action.
 * The load order helps to execute code at the correct time.
 *                                              v---Load order
 */
add_action( 'bbp_init', 'bbp_register',         1   );
add_action( 'bbp_init', 'bbp_load_textdomain',  0   );
add_action( 'bbp_init', 'bbp_add_rewrite_tags', 20  );
add_action( 'bbp_init', 'bbp_ready',            999 );

results:

Successfully translated.
has attached image admin_menu_result.png​

Likely not a bug in bbPress?
I think that it is a bug.

Last edited 8 years ago by toemon (previous) (diff)

#8 @alexvorn2
8 years ago

  • Keywords needs-patch added

#9 @alexvorn2
8 years ago

  • Milestone changed from Awaiting Review to 2.3

#10 @johnjamesjacoby
8 years ago

Ironically, we had a complaint of it loading too early, which is how this changed. See r4404.

Someone want to get this figured out?

#11 @johnjamesjacoby
8 years ago

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

(In [4559]) Load the textdomain before bbp_register. Fixes #2073.

Note: See TracTickets for help on using tickets.