Opened 12 years ago
Closed 12 years ago
#2073 closed defect (bug) (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)
Change History (13)
#2
@
12 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
@
12 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.
#7
@
12 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.
admin menu