Skip to content

Commit

Permalink
Merge pull request #1129 from GeertDD/menu_names
Browse files Browse the repository at this point in the history
Allow custom translations for admin menu names
  • Loading branch information
mikejolley committed Jun 8, 2012
2 parents 3e3698a + 6128a82 commit e128fc0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions woocommerce.php
Expand Up @@ -577,6 +577,7 @@ function init_taxonomy() {
'labels' => array(
'name' => __( 'Product Categories', 'woocommerce'),
'singular_name' => __( 'Product Category', 'woocommerce'),
'menu_name' => _x( 'Product Categories', 'Admin menu name', 'woocommerce' ),
'search_items' => __( 'Search Product Categories', 'woocommerce'),
'all_items' => __( 'All Product Categories', 'woocommerce'),
'parent_item' => __( 'Parent Product Category', 'woocommerce'),
Expand Down Expand Up @@ -607,6 +608,7 @@ function init_taxonomy() {
'labels' => array(
'name' => __( 'Tags', 'woocommerce'),
'singular_name' => __( 'Product Tag', 'woocommerce'),
'menu_name' => _x( 'Tags', 'Admin menu name', 'woocommerce' ),
'search_items' => __( 'Search Product Tags', 'woocommerce'),
'all_items' => __( 'All Product Tags', 'woocommerce'),
'parent_item' => __( 'Parent Product Tag', 'woocommerce'),
Expand Down Expand Up @@ -637,6 +639,7 @@ function init_taxonomy() {
'labels' => array(
'name' => __( 'Shipping Classes', 'woocommerce'),
'singular_name' => __( 'Shipping Class', 'woocommerce'),
'menu_name' => _x( 'Shipping Classes', 'Admin menu name', 'woocommerce' ),
'search_items' => __( 'Search Shipping Classes', 'woocommerce'),
'all_items' => __( 'All Shipping Classes', 'woocommerce'),
'parent_item' => __( 'Parent Shipping Class', 'woocommerce'),
Expand Down Expand Up @@ -731,6 +734,7 @@ function init_taxonomy() {
'labels' => array(
'name' => __( 'Products', 'woocommerce' ),
'singular_name' => __( 'Product', 'woocommerce' ),
'menu_name' => _x( 'Products', 'Admin menu name', 'woocommerce' ),
'add_new' => __( 'Add Product', 'woocommerce' ),
'add_new_item' => __( 'Add New Product', 'woocommerce' ),
'edit' => __( 'Edit', 'woocommerce' ),
Expand Down Expand Up @@ -825,12 +829,11 @@ function init_taxonomy() {
set_transient( 'woocommerce_processing_order_count', $order_count );
}

if ( $order_count === false ) {
$menu_name = __('Orders', 'woocommerce');
} else {
$menu_name = __('Orders', 'woocommerce'). " <span class='awaiting-mod count-$order_count'><span class='processing-count'>" . number_format_i18n( $order_count ) . "</span></span>" ;
}

$menu_name = _x('Orders', 'Admin menu name', 'woocommerce');
if ( $order_count ) {
$menu_name .= " <span class='awaiting-mod count-$order_count'><span class='processing-count'>" . number_format_i18n( $order_count ) . "</span></span>" ;
}

register_post_type( "shop_order",
array(
'labels' => array(
Expand Down Expand Up @@ -881,6 +884,7 @@ function init_taxonomy() {
'labels' => array(
'name' => __( 'Coupons', 'woocommerce' ),
'singular_name' => __( 'Coupon', 'woocommerce' ),
'menu_name' => _x( 'Coupons', 'Admin menu name', 'woocommerce' ),
'add_new' => __( 'Add Coupon', 'woocommerce' ),
'add_new_item' => __( 'Add New Coupon', 'woocommerce' ),
'edit' => __( 'Edit', 'woocommerce' ),
Expand Down

0 comments on commit e128fc0

Please sign in to comment.