Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #104818
    chrisDug
    Participant

    I have my site setup using Polylang to translate my site from English to French however when i click the French button the Featured slider and promotional Headline does not translate. Ive noticed that when I change the Language while inside of WP-customizer the slider translates but once I save and exit it locks onto the language that was active when i exit customizer. any help with this would be much appreciated im using wordpress 4.7 and the most recent version of Polylang translator. my site is http://michellevesquelifeinsurance.ca/

    Thanks!!

    #104884
    Mahesh
    Participant

    @chirsdug: For this, you’ll need to create a child theme. You can find more details on creating child theme HERE. Then in your child theme’s functions.php, add the following codes:

    if ( ! function_exists( 'catchresponsive_child_polylang_invalidcache' ) ) :
    /**
     * Template for Clearing Polylang Invalid Cache
     *
     */
    function catchresponsive_child_polylang_invalidcache() {
    	delete_transient( 'catchresponsive_promotion_headline' );
    	delete_transient( 'catchresponsive_featured_content' );
    	delete_transient( 'catchresponsive_featured_slider' );
    } // catchresponsive_child_polylang_invalidcache
    endif;
    add_action( 'after_setup_theme', 'catchresponsive_child_polylang_invalidcache' );

    This function is for Promotion Headline for custom language, with give you option to put the desired text for the translation.

    function catchresponsive_child_polylang() {
    	if ( function_exists( 'pll_register_string' ) ) {
    		$options 	= catchresponsive_get_theme_options();
    
    		$promotion_headline        = $options['promotion_headline'];
    		$promotion_subheadline     = $options['promotion_subheadline'];
    		$promotion_headline_button = $options['promotion_headline_button'];
    		$headline                  = $options ['featured_content_headline'];
    		$subheadline               = $options ['featured_content_subheadline'];
    
    		pll_register_string( 'featured_content_headline', $headline );
    		pll_register_string( 'featured_content_subheadline', $subheadline );
    		pll_register_string( 'promotion_headline', $promotion_headline );
    		pll_register_string( 'promotion_subheadline', $promotion_subheadline );
    		pll_register_string( 'promotion_headline_button', $promotion_headline_button );
    	}
    }
    add_action ( 'admin_init', 'catchresponsive_child_polylang' );

    Regards,
    Mahesh

    #104926
    chrisDug
    Participant

    Hi Mahesh

    Thank you very much for your reply i was able to fix the slider issue however the promotion headline still does not translate or give me an option to add the translation in customizer. I noticed also that the title for featured content does not translate either. Thank you in advance for the help it is much apreciated!!

    Thanks
    Chris

    #104984
    Mahesh
    Participant

    @chrisdug: It won’t add the translation option in the Customizer but gives you option to add translation within the plugin. Go to Dashboard=> Appearance=> Settings=> Languages and select String Translation tab. You can add the translation for Promotion Headline here.
    Note: Added the translation options for Featured Content Headline and Sub Headline in the above code.

    Regards,
    Mahesh

    #104988
    chrisDug
    Participant

    Thank you soo much @Mahesh for the quick reply i added the stings into the settings but when i go on the site it is still not translating.

    Thanks!!
    Chris

    #105000
    Mahesh
    Participant

    @chirsdug: Thank you for your appreciation. Have a nice day!

    Regards,
    Mahesh

    #105227
    chrisDug
    Participant

    Hi @Mahesh

    I added the Featured headline and promotion headline strings into the settings but when i go on the site it is still not translating. Any Help you can provide is very much appreciated.

    Thank you!
    Chris

    #105270
    Mahesh
    Participant

    @chirsdug: Please contact the plugin support for the issue. This is the most we can do from the theme point of view.
    Hope you understand.

    Regards,
    Mahesh

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘How do I get the Featured slider, promotion headline to Translate with polylang’ is closed to new replies.