From 65eb16fe8a305726e3ea1dcee5985e64b87df962 Mon Sep 17 00:00:00 2001 From: George Stephanis Date: Fri, 7 Aug 2015 11:47:39 -0400 Subject: [PATCH] Migrate csv columns to localize script. --- .../js/admin/settings-views-html-settings-tax.js | 13 +------------ .../admin/settings/views/html-settings-tax.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/assets/js/admin/settings-views-html-settings-tax.js b/assets/js/admin/settings-views-html-settings-tax.js index f02869c2f5a..6ca249260e2 100644 --- a/assets/js/admin/settings-views-html-settings-tax.js +++ b/assets/js/admin/settings-views-html-settings-tax.js @@ -34,18 +34,7 @@ jQuery('.wc_tax_rates .export').click(function() { - var csv_data = "data:application/csv;charset=utf-8,\n"; + var csv_data = 'data:application/csv;charset=utf-8,' + data.strings.csv_data_cols.join(',') + '\n'; jQuery('#rates tr:visible').each(function() { var row = ''; diff --git a/includes/admin/settings/views/html-settings-tax.php b/includes/admin/settings/views/html-settings-tax.php index 8e9b689b0a6..77d598a94f7 100644 --- a/includes/admin/settings/views/html-settings-tax.php +++ b/includes/admin/settings/views/html-settings-tax.php @@ -26,8 +26,20 @@ wp_localize_script( 'wc-settings-tax', 'htmlSettingsTaxLocalizeScript', array( 'page' => $page, 'limit' => $limit, 'strings' => array( - + 'csv_data_cols' => array( + __( 'Country Code', 'woocommerce' ), + __( 'State Code', 'woocommerce' ), + __( 'ZIP/Postcode', 'woocommerce' ), + __( 'City', 'woocommerce' ), + __( 'Rate %', 'woocommerce' ), + __( 'Tax Name', 'woocommerce' ), + __( 'Priority', 'woocommerce' ), + __( 'Compound', 'woocommerce' ), + __( 'Shipping', 'woocommerce' ), + __( 'Tax Class', 'woocommerce' ), + ), ), + ) ); wp_enqueue_script( 'wc-settings-tax' );