qTranslate + WooCommerce-qTML + WooCommerce Aggiungere CF e P.IVA not translate custom fields in checkout page

StackOverflow https://stackoverflow.com/questions/20083714

I have a problem with my project. I'm using a Wordpress theme NOT native for WooCommerce. I'm implemented anyway WooCommerce, and it works great. Now, i have a problem. WooCommerce doesn't contain italian custom fields "C.F." and "P.IVA". So i've found a plugin that provides to create and configure these custom fields. The plugin is: http://netstarsolution.net/aggiungere-cf-e-pi-wc/.

The problem is that when i active qTranslate and WooCommerce-qTML (for WooCommerce), the custom fields inserted by "WooCommerce Aggiungere CF e P.IVA" not are translated. Only custom fields inserted with "WooCommerce Aggiungere CF e P.IVA" plugin doesn't works.

This is the part that's not translating:

// Billing First Name. 
$fields['billing']['billing_first_name'] = array( 
    'label' => __( 'First Name', 'wcbcf' ), 
    'placeholder' => _x( 'First Name', 'placeholder', 'wcbcf' ), 
    'required' => true, 
    'class' => array( 'form-row-first' ),
);
有帮助吗?

解决方案

Ok I resolved it. Post here the solution for someone that has my same problem.

Well, the solution is basically a hack to the plugin itself (NOT the qTranslate plugin, just the other ones ONLY). What you do is find within the plugin the load_plugin_textdomain function call.

Code:

    load_plugin_textdomain('your_plugin_identifier', false, dirname( plugin_basename(__FILE__) ) . '/languages');

add_action('init', 'init_textdomain');
function init_textdomain() {
   load_plugin_textdomain(''your_plugin_identifier', false, dirname( plugin_basename(__FILE__) ) . '/languages');
}

Thanks to this post: http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=1800

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top