From 59dc477a20e175c16e4a922e6ad70ca27690e738 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Wed, 26 Oct 2016 02:34:50 +0300 Subject: [PATCH] Direction characters (i18n, RLT, a11y) (#12177) * RTL+i18n: product title stricture as translation string to allow RTL languages to change `→` TO `←` * i18n: move the `→` into the translation string to allow RTL languages to translate to `←` * RTL: product filter indent using `→` and `←` chars * a11y: remove `←` char, it's a bad accessibility practice to use visual indicators to point to menus * a11y: remove `←` char, it's a bad accessibility practice to use visual indicators to point to menus --- includes/admin/class-wc-admin-post-types.php | 4 ++-- .../admin/meta-boxes/class-wc-meta-box-order-data.php | 8 ++++---- .../admin/reports/class-wc-report-sales-by-category.php | 2 +- .../admin/reports/class-wc-report-sales-by-product.php | 2 +- includes/class-wc-product-simple.php | 5 +++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/includes/admin/class-wc-admin-post-types.php b/includes/admin/class-wc-admin-post-types.php index f8206ebb791..ecb95c74604 100644 --- a/includes/admin/class-wc-admin-post-types.php +++ b/includes/admin/class-wc-admin-post-types.php @@ -1653,7 +1653,7 @@ class WC_Admin_Post_Types { $output .= selected( 'downloadable', $wp_query->query['product_type'], false ); } - $output .= '> → ' . __( 'Downloadable', 'woocommerce' ) . ''; + $output .= '> ' . ( is_rtl() ? '←' : '→' ) . ' ' . __( 'Downloadable', 'woocommerce' ) . ''; $output .= ''; + $output .= '> ' . ( is_rtl() ? '←' : '→' ) . ' ' . __( 'Virtual', 'woocommerce' ) . ''; } } diff --git a/includes/admin/meta-boxes/class-wc-meta-box-order-data.php b/includes/admin/meta-boxes/class-wc-meta-box-order-data.php index c738d197d76..7848bcfb1bf 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-order-data.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-order-data.php @@ -210,9 +210,9 @@ class WC_Meta_Box_Order_Data {

@@ -233,9 +233,9 @@ class WC_Meta_Box_Order_Data { 'post_type' => 'shop_order', '_customer_user' => absint( $order->get_user_id() ), ); - printf( '%s →', + printf( '%s', esc_url( add_query_arg( $args, admin_url( 'edit.php' ) ) ), - __( 'View other orders', 'woocommerce' ) + __( 'View other orders →', 'woocommerce' ) ); } ?> diff --git a/includes/admin/reports/class-wc-report-sales-by-category.php b/includes/admin/reports/class-wc-report-sales-by-category.php index 2dcc9fb8355..f7b293e083e 100644 --- a/includes/admin/reports/class-wc-report-sales-by-category.php +++ b/includes/admin/reports/class-wc-report-sales-by-category.php @@ -279,7 +279,7 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report { if ( empty( $this->show_categories ) ) { ?>

-

+

product_ids ) ) { ?>
-

+

post->post_title; if ( $this->get_parent() > 0 ) { - $title = get_the_title( $this->get_parent() ) . ' → ' . $title; + /* translators: 1: parent product title 2: product title */ + $title = sprintf( __( '%1$s → %2$s' , 'woocommerce' ), get_the_title( $this->get_parent() ), $title ); } return apply_filters( 'woocommerce_product_title', $title, $this );