• First off, I want to thank Nikeo for this awesome theme.

    In this guide I will teach what needs to be modified in the current version (3.0.8) in order to make Customizr play nice with qTranslate. However, my sincere hope is that in some future version, Customizr will become multilingual ready and all these tiny mods won’t be necessary.

    PLEASE BEWARE: If you modify theme files you will lose all those mods on theme update so only do this if you’re willing to do them again with each version or if you’re going to freeze updates for Customizr.

    1. Remove limitations on slider titles, slider descriptions and slider buttons:
    Go to /wp-content/themes/customizr/inc/admin/class-admin-meta-boxes.php and comment out the following lines: 521 to 527, 552 to 558, 756 to 762 (the if-s, with the corresponding accolade). To comment out you either put // in front of each line, or you put /* before the block of lines and */ at the end. Example: (how to comment out lines 756 to 762):

    default://for button, color, title and post link field (actually not a link but an id)
    /*                       if (strlen( $mydata) > 80) {
                            $mydata = substr( $mydata,0,strpos( $mydata, ' ' ,80));
                            $mydata = esc_attr( $mydata) . ' ...';
                            }
                            else {
                              $mydata = esc_attr( $mydata);
                            }
    */                     break;

    To remove the 200 chars limitation for featured pages description (between the image and the button, on first page) you need to comment out lines 118 to 125 in /wp-content/themes/customizr/parts/class-content-featured_pages.php.

    An alternative to removing the limitations is to set them higher, in accordance with the number of languages your multilingual website will be set to (double the limit for 2 languages, triple it for 3, etc.).

    This is because qTranslate saves all languages content in the same field and parses the text before it gets output to the browser, only keeping the active language content.

    2. run __() function on content before it gets output in browser
    After we have removed the limitations, we have to make sure that qTranslate actually parses the texts before they get printed in the browser. To do that, we have to make sure they are run by the __() function, but before the text is run through any of the esc_attr(), esc_html() or any similar functions, as they might strip away the language shortcodes.

    For multilingual slider, you need to apply the __() function on $title, $text and $button_text variables in /wp-content/themes/customizr/parts/class-header-slider.php on lines 188, 189 and 191, before the esc_attr() and esc_html() functions, like this:

    $title              = esc_attr(__(get_post_meta( $id, $key = 'slide_title_key' , $single = true )));
                            $text               = esc_html(__(get_post_meta( $id, $key = 'slide_text_key' , $single = true )));
                            $text_color         = esc_attr(get_post_meta( $id, $key = 'slide_color_key' , $single = true )); // this line doesn't need modifying
                            $button_text        = esc_attr(__(get_post_meta( $id, $key = 'slide_button_key' , $single = true )));

    As of now, I haven’t been able to make multilingual excerpts for pages work with Customizr, but I was able to display multilingual content in featured pages area using laguage shortcodes (eg: [:en]English featured page text[:es]Spanish featured page text) in the custom descriptions provided by the Customizr options screen. For this to work you need to wrap the $text variable in __() function on line 196 in /wp-content/themes/customizr/parts/class-content-featured_pages.php, like this:

    <p class=”fp-text-<?php echo $area ?>”><?php echo __($text); ?></p>

    and, for the buttons, on line 199:

    <?php echo esc_attr(__(tc__f(‘__get_option’ , ‘tc_featured_page_button_text’))) ?>

    I hope I didn’t forget anything and also that this helps those of you who were desperately hoping for a solution to make Customizr slider and featured pages multilingual.

    One more thing: in order for all this to work you have to put multilingual texts in the slide fields using qTranslate shortcodes ([:en] english text[:es]spanish text, etc). This is obvious for many, but you need to actually do it in order for the whole thing to work. ??

    Wishing some tweaks into future releases of the theme will render my post useless, I thank you for your time.

Viewing 8 replies - 46 through 53 (of 53 total)
  • Thank you but as far as I can get it I see that this one is for the tagline of the site. I am concerned about the description field of the single image slide. still looking to understand why the quicktag of qtranslate is not working into it. as I reported the interested file is the class-header-slider.php and the lines are

    `<div class=”carousel-image <?php echo $img_size ?>”>
    <?php echo $slide_to_display ?>
    </div>

    <?php if ( $title != null || $text != null || $button_text != null ) : ?>

    <div class=”carousel-caption”>

    <?php if( $title != null) : ?>
    <h1 <?php echo $color_style ?>><?php echo __($title) ?></h1>
    <?php endif; ?>

    <?php if( $text != null) : ?>
    <p <?php echo $color_style ?> class=”lead”><?php echo __($text) ?></p>
    <?php endif; ?>

    <?php if( $button_text != null && $button_link != null) : ?>
    <a>”><?php echo __($button_text) ?></a>

    <?php elseif( $button_text != null ) : ?>
    <a href=”#”><?php echo __($button_text)?></a>
    <?php endif; ?>

    </div>`

    could be hard coded in php but is not the best solution, i am still interested in getting it out through the qtranslate and customizr interaction.

    hi, acub, your solution is really amazing, what a pain that does’nt work for me see foamfatale.com I tried what I found in this topic already. Can you please exactly tell me what and where in my child theme ought to put to have qtranslate buttons (about 6) on the left of the logo?
    Many thanks in advance G.

    Thread Starter acub

    (@acub)

    This topic is obsolete and outdated.
    Customizr has integrated support for qTranslate now.
    Please describe your problem in a new topic.

    acub, thx for the info but I do not understand why were my question obsolete and outdated. There is no integrated solution in customizr to paste the qtranslate icons neither to the left side of the logo nor in the menu bar. Conserning that our homepage is set up without sidebars, there is no other right place for them. The footer, where I can put them is not ideal. Any suggestion? Ought I open a new topic “How to paste the qtranslate icons to the left side of the logo or in the menu bar”? I would do it with pleasure if you wish.

    Thread Starter acub

    (@acub)

    Because the initial post of this topic was on how to make Customizr compatible with qTranslate, not on how to hook the language chooser. At the point this was written, you couldn’t input qTranlaste shortcodes into button text, description and/or title of slider, or featured pages either. So, even though related, your request needs its own topic.

    Just installe wordpress 3.8 and Customizr 3.0.15 as well as qTranslate and in the slider as well as the tagline neither [:en] or <!–:en–><!–:–> in the title nor the description.

    Thread Starter acub

    (@acub)

    Customizr 3.0.15 does not have support for qTranslate. You should update to the latest version (3.1.4).

Viewing 8 replies - 46 through 53 (of 53 total)
  • The topic ‘Multilingual Customizr – how to guide (using qTranslate) for Customizr 3.0.8’ is closed to new replies.