Migrate csv columns to localize script.

This commit is contained in:
George Stephanis 2015-08-07 11:47:39 -04:00
parent 974b337fbb
commit 65eb16fe8a
2 changed files with 14 additions and 13 deletions

View File

@ -34,18 +34,7 @@
jQuery('.wc_tax_rates .export').click(function() { jQuery('.wc_tax_rates .export').click(function() {
var csv_data = "data:application/csv;charset=utf-8,<?php echo esc_js( implode( ',', array( var csv_data = 'data:application/csv;charset=utf-8,' + data.strings.csv_data_cols.join(',') + '\n';
__( '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' ),
) ) ); ?>\n";
jQuery('#rates tr:visible').each(function() { jQuery('#rates tr:visible').each(function() {
var row = ''; var row = '';

View File

@ -26,8 +26,20 @@ wp_localize_script( 'wc-settings-tax', 'htmlSettingsTaxLocalizeScript', array(
'page' => $page, 'page' => $page,
'limit' => $limit, 'limit' => $limit,
'strings' => array( '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' ); wp_enqueue_script( 'wc-settings-tax' );