[wp-trac] [WordPress Trac] #27524: The titles of columns in the admin aren't translated with custom post types and custom taxonomies

WordPress Trac noreply at wordpress.org
Wed Mar 26 11:27:52 UTC 2014


#27524: The titles of columns in the admin aren't translated with custom post types
and custom taxonomies
-------------------------------+------------------------------
 Reporter:  benoitchantre      |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  I18N               |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+------------------------------

Comment (by benoitchantre):

 Replying to [comment:3 SergeyBiryukov]:
 > Could you provide your post type registration code to reproduce the
 issue?

 Here's my code

 {{{
 /**
  * Register Custom Taxonomy.
  */
 function ts_place_taxonomy()  {
     $labels = array(
         'name'                       => _x( 'Places', 'Taxonomy General
 Name', 'mydomain' ),
         'singular_name'              => _x( 'Place', 'Taxonomy Singular
 Name', 'mydomain' ),
         'menu_name'                  => __( 'Places', 'mydomain' ),
         'all_items'                  => __( 'All Places', 'mydomain' ),
         'parent_item'                => __( 'Parent Place', 'mydomain' ),
         'parent_item_colon'          => __( 'Parent Place:', 'mydomain' ),
         'new_item_name'              => __( 'New Place Name', 'mydomain'
 ),
         'add_new_item'               => __( 'Add New Place', 'mydomain' ),
         'edit_item'                  => __( 'Edit Place', 'mydomain' ),
         'update_item'                => __( 'Update Place', 'mydomain' ),
         'separate_items_with_commas' => __( 'Separate places with commas',
 'mydomain' ),
         'search_items'               => __( 'Search Places', 'mydomain' ),
         'add_or_remove_items'        => __( 'Add or remove places',
 'mydomain' ),
         'choose_from_most_used'      => __( 'Choose from the most used
 places', 'mydomain' ),
     );
     $args = array(
         'labels'                     => $labels,
         'hierarchical'               => false,
         'public'                     => true,
         'show_ui'                    => true,
         'show_admin_column'          => true,
         'show_in_nav_menus'          => false,
         'show_tagcloud'              => false,
         'meta_box_cb'                => false,
     );
     register_taxonomy( 'ts_place', 'ts_animal', $args );
 }

 // Hook into the 'init' action
 add_action( 'init', 'ts_place_taxonomy', 0 );


 /**
  * Register Custom Post Type.
  */
 function ts_animal_post_type() {
     $labels = array(
         'name'                => _x( 'Animals', 'Post Type General Name',
 'mydomain' ),
         'singular_name'       => _x( 'Animal', 'Post Type Singular Name',
 'mydomain' ),
         'menu_name'           => __( 'Animals', 'mydomain' ),
         'parent_item_colon'   => __( 'Parent Animal:', 'mydomain' ),
         'all_items'           => __( 'All Animals', 'mydomain' ),
         'view_item'           => __( 'View Animal', 'mydomain' ),
         'add_new_item'        => __( 'Add New Animal', 'mydomain' ),
         'add_new'             => __( 'New Animal', 'mydomain' ),
         'edit_item'           => __( 'Edit Animal', 'mydomain' ),
         'update_item'         => __( 'Update Animal', 'mydomain' ),
         'search_items'        => __( 'Search animals', 'mydomain' ),
         'not_found'           => __( 'No animals found', 'mydomain' ),
         'not_found_in_trash'  => __( 'No animals found in Trash',
 'mydomain' ),
     );
     $args = array(
         'label'               => __( 'animal', 'mydomain' ),
         'description'         => __( 'Animal information pages',
 'mydomain' ),
         'labels'              => $labels,
         'supports'            => array( 'title', 'editor', 'page-
 attributes', 'thumbnail', 'revisions'),
         'taxonomies'          => array( 'species' ),
         'hierarchical'        => true,
         'public'              => true,
         'rewrite'             => array('slug' => __( 'animals', 'mydomain'
 )),
         'show_ui'             => true,
         'show_in_menu'        => true,
         'show_in_nav_menus'   => false,
         'show_in_admin_bar'   => true,
         'menu_position'       => 20,
         'menu_icon'           => '',
         'can_export'          => true,
         'has_archive'         => false,
         'exclude_from_search' => false,
         'publicly_queryable'  => true,
         'capability_type'     => 'page',
     );
     register_post_type( 'ts_animal', $args );
 }

 // Hook into the 'init' action
 add_action( 'init', 'ts_animal_post_type', 0 );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27524#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list