• Resolved lseco

    (@lseco)


    Hi,
    I’m building a multilingual WordPress site, themed with Customizr and using Polylang as plugin.
    I would like to know how can I have a localized front pages with a localized slider (just textes) and featured content.
    Even a workaround would be good.
    The problem is that the customizr option page permits setting in just one language.
    I know that it’s possible, cause the default front page get localized in correct languages, as i switch language on site using language switcher widget.

    Thanks.

    https://www.ads-software.com/plugins/polylang/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Chouby

    (@chouby)

    Thread Starter lseco

    (@lseco)

    Tried the solution: it works in the backend (preview), but doesn’t work as you publish site. The live site doesn’t show the localized strings, but just the default ones, as if it wouldn’t be present specific text.
    Tried on the 3rd featured page, 1st and 2nd left without text.

    Still remains problem in translating the front page slider text (carousel).

    Thanks for quick provisioning a tentative solution however ??

    Plugin Author Chouby

    (@chouby)

    Sorry. For the moment it works only if the language is set from url (directory, subdomain or domain name). I will add this precision in the blog post. Where do you define the slider? I have only the demo slider which translates.

    Thread Starter lseco

    (@lseco)

    The slider for front page can be defined on media gallery, clicking on an image uploaded and then turning on the slider switch on the bottom of image’s edit screen.
    There you can define to which slider that image belongs to or create a brand new one.

    The default slider tranlates, i noticed.

    Thanks

    Plugin Author Chouby

    (@chouby)

    Could you try with this code:

    <?php
    /*
    Plugin Name: Polylang Customizr
    Description: Makes Customizr frontpage multilingual with Polylang
    License: GPLv3
    */
    
    if (defined('POLYLANG_VERSION'))
    	add_filter('option_tc_theme_options', 'pll_tc_options');
    
    function pll_tc_options($options) {
    	$areas = array('one', 'two', 'three');
    	if (is_admin()) {
    		foreach ($areas as $area)
    			pll_register_string('tc_featured_text_'.$area, $options['tc_featured_text_'.$area], 'Customizr', true);
    	}
    
    	else {
    		foreach ($areas as $area) {
    			$options['tc_featured_text_'.$area] = pll__($options['tc_featured_text_'.$area]);
    			$options['tc_featured_page_'.$area] = pll_get_post($options['tc_featured_page_'.$area]);
    		}
    
    		// filters sliders by language
    		$pll_options = get_option('polylang');
    
    		if (!empty($options['tc_sliders']) && $pll_options['media_support']) {
    			foreach ($options['tc_sliders'] as $slider => $images)
    				foreach ($images as $key => $img)
    					if (!(($id = pll_get_post($img)) && $id == $img))
    						unset($options['tc_sliders'][$slider][$key]);
    		}
    	}
    
    	return $options;
    }

    Thread Starter lseco

    (@lseco)

    It works in preview, both featured and slider.

    Can’t test on live site cause options for URL rewriting are not selectable (dots just greyed out).

    Thanks

    Thread Starter lseco

    (@lseco)

    Sorry, as partial correction, in preview the correct translated featured page title is shown, but the associated string remains the original one (that typed in customizr setting page).

    Plugin Author Chouby

    (@chouby)

    Can’t test on live site cause options for URL rewriting are not selectable (dots just greyed out).

    That certainly because you are using default permalinks. Go in Settings->permalinks and choose a pretty permalinks option such as “Post name”

    Thread Starter lseco

    (@lseco)

    GREAT! It works ??

    Many many thanks for your more than quick support.

    Hi,

    Is this issue fixed in the new release of Polylang?

    Thanks

    Plugin Author Chouby

    (@chouby)

    There is no issue and there is no fix inncluded in Polylang. The topic here proposes a bridge plugin to allow Polylang to translate some specific parts of Customizr. See also:
    https://polylang.wordpress.com/2013/11/12/polylang-and-the-customizr-theme/

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Polylang Customizr: Multilingual front page – slider and featured content’ is closed to new replies.