• Francisco

    (@fmarconi)


    Hi, I’m learning to customize translations. I don’t want to load translation plugins on every site so I put my custom woocommerce MO file translation on a new child theme folder and then using load_textdomain_mo filter on my functions.php I pointed to it. I’ve tried to do the same with Quotes for WooCommerce, but the quote-wc domain is not recognized.
    What I am doing wrong?
    I use your plugin very often so thank you very much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author pinal.shah

    (@pinalshah)

    Hi @fmarconi,

    Can you kindly share the code which you have setup in functions.php?

    Usually you can simply place the translated file in wp-content/plugins/quotes-for-woocommerce/languages folder.

    Can you kindly check once if placing the translated file there helps?

    Please let me know.

    Thanks,
    Pinal

    Thread Starter Francisco

    (@fmarconi)

    Hi, Pinal, Yes I can place my translation there and its OK, but when I build a new site, I would like to just paste a child theme folder with all translations in there and not worry browsing through the WP folders. Its just more convenient. Thanks.

    add_filter( 'load_textdomain_mofile', 'load_custom_plugin_translation_file', 10, 2 );
    function load_custom_plugin_translation_file( $mofile, $domain )
    {
    		//echo('<pre>');print_r($mofile);echo('</pre>');
    	if ( 'woocommerce' === $domain )
    	{
    		$mofile = WP_CONTENT_DIR . '/themes/kadence-child/traducciones/woocommerce-' . get_locale() . '.mo';
    	}
    	if ( 'quote-wc' === $domain) //No lo encuentra :(
    	{
    		$mofile = WP_CONTENT_DIR . '/themes/kadence-child/traducciones/quote-wc-' . get_locale() . '.mo';
    	}
    	return $mofile;
    }
    Plugin Author pinal.shah

    (@pinalshah)

    Hi @fmarconi,

    Ah, I understand. It would definitely be more convenient. I’ll look into this and let you know.

    Thanks,
    Pinal

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Another translation question’ is closed to new replies.