Title: dataTables language
Last modified: January 8, 2023

---

# dataTables language

 *  Resolved [wpaga](https://wordpress.org/support/users/wpaga/)
 * (@wpaga)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/datatables-language/)
 * Hello
   Is there a way to change the Vendors dataTable language?I see that in “
   public/assets/js/public.js” the dataTable gets its language from the “marketking_display_settings”
   defined in “public/class-marketking-core-public.php”, but this is hardcoded to“
   English” and this file isn’t overwritten if I move it to “__my_theme__/marketking”
   folder.
 * If fact there are more changes that I would like to do in “marketking_display_settings”.
   Is there a way to do it?
 * Thank you

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [WebWizards](https://wordpress.org/support/users/webwizardsdev/)
 * (@webwizardsdev)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/datatables-language/#post-16352822)
 * Hi there!
 * Thanks for using the plugin,
 * We should probably add a setting for that language, but right now it can be changed
   by adding this PHP code snippet to your site:
 *     ```wp-block-code
       add_filter('marketking_tables_language_option_setting', function($lang){
       	$lang = 'Spanish';
       	return $lang;
       }, 10, 1);
       ```
   
 * This can be added to the functions.php of your child theme, or to any Snippets
   plugin.
 * If you would like to change various texts, generally we’d recommend using the
   Loco Translate plugin. Or are you looking to change something that is not a text?
 *  Thread Starter [wpaga](https://wordpress.org/support/users/wpaga/)
 * (@wpaga)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/datatables-language/#post-16353507)
 * Hello and thank you for the quick response.
   I’ve solved this issue by overwriting
   the var in javascript (adding marketking_display_settings[‘tables_language_option’]
   = … in footer.php)but the snippet you wrote would be very useful.
 * What I also wanted to do, is to change the “Follow / Following” texts with icons,
   but right now the html code is rendered as text (public.js 1957, 1959)
   I’ve overwritten
   the on(‘click’) function but it’s not always working as expected. Sometimes it
   returns the icon html code…
 *  Plugin Author [WebWizards](https://wordpress.org/support/users/webwizardsdev/)
 * (@webwizardsdev)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/datatables-language/#post-16356906)
 * I think indeed a good solution could be to first remove the click function from
   the button:
 *     ```wp-block-code
       jQuery('.marketking_follow_button').off('click');
       ```
   
 * and then add your own custom function:
 *     ```wp-block-code
       jQuery('.marketking_follow_button').on('click', function(){	
       	var datavar = {
               action: 'marketking_change_follow_status',
               security: marketking_display_settings.security,
               vendorid: jQuery(this).val(),
           };
   
           let th = jQuery(this);
   
           jQuery.post(marketking_display_settings.ajaxurl, datavar, function(response){
           	if (response === 'followed'){
           		// set text
           		jQuery(th).text('test1');
           	} else if (response === 'unfollowed'){
           		jQuery(th).text('test2');
           	}
           });
   
       });
       ```
   
 * To make that an icon, you would probably want to use the .html() function instead
   of .text()
 *  Thread Starter [wpaga](https://wordpress.org/support/users/wpaga/)
 * (@wpaga)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/datatables-language/#post-16357263)
 * This is exactly what I’ve tried (using ‘off’ and ‘html’) but it is not functioning
   correctly.
   Sometimes, it gives me the icon, but some other times it outputs the
   icon’s html code. I can’t see why…
 * Maybe the simplest way to solve this, is if you would change the ‘text’ to ‘html’
   in a future update 🙂 . The would give users the freedom to change this part,
   as they wish.
 * Anyway, this is not a major issue. I can live with the ‘follow’ text. 🙂
   Thank
   you for your time.
 *  Plugin Author [WebWizards](https://wordpress.org/support/users/webwizardsdev/)
 * (@webwizardsdev)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/datatables-language/#post-16358154)
 * I have now changed that to .html() in the code base (will work in the next update).
 * Have a nice day!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘dataTables language’ is closed to new replies.

 * ![](https://ps.w.org/marketking-multivendor-marketplace-for-woocommerce/assets/
   icon-256x256.jpg?rev=2707404)
 * [MarketKing — Ultimate WooCommerce Multivendor Marketplace Solution](https://wordpress.org/plugins/marketking-multivendor-marketplace-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/marketking-multivendor-marketplace-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/marketking-multivendor-marketplace-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/marketking-multivendor-marketplace-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/marketking-multivendor-marketplace-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/marketking-multivendor-marketplace-for-woocommerce/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [WebWizards](https://wordpress.org/support/users/webwizardsdev/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/datatables-language/#post-16358154)
 * Status: resolved