• Resolved Csilla Molnar

    (@csillamolnar)


    Hi,

    I have a website built with Flatsome that I want to translate with FaLang. It also works nicely, with one exception.

    The Footer is a UX Block element, which I translated on the Translate Post Menu. (Where the Falang recognize as a block).
    However, in practice, the translation doesn’t want to appear on the site at all.

    I have already tried everything, turned on all the translation options, automatic language recognition, jquery parts, everything I could, but nothing.
    So the block in the Footer refuses to translate….

    Any idea how I can do this?

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

    (@sbouey)

    Hi,

    I don’t know this theme
    It’s possive to put screenshot of the Footer UX Block and the Falang Translate Post pagge.

    Stépahne
    faboba

    Thread Starter Csilla Molnar

    (@csillamolnar)

    In the meantime, I have managed to understand the problem in more detail. I attach the Flatsome code snippet which belongs here, which shows that the id of the global footer is obtained by the get_theme_mod function and it is generated with the do_shortcode function.
    So I guess the only question is how to change the value of get_theme_mod (‘footer_block’).

    `function flatsome_page_footer(){
    $block = get_theme_mod( ‘footer_block’ );

    if ( is_page() ) {
    // Custom Page footers.
    $page_footer = get_post_meta( get_the_ID(), ‘_footer’, true );
    $default = empty( $page_footer ) || $page_footer == ‘normal’;

    if ( $page_footer !== ‘disabled’ ) {
    if ( ! $block ) {
    if ( $default ) {
    get_template_part( ‘template-parts/footer/footer’ );
    } elseif ( ! empty( $page_footer ) ) {
    get_template_part( ‘template-parts/footer/footer’, $page_footer );
    }
    } else {
    echo do_shortcode( ‘[block id=”‘ . $block . ‘”]’ );
    get_template_part( ‘template-parts/footer/footer-absolute’ );
    }
    }
    } else {
    // Global footer.
    if ( $block ) {
    echo do_shortcode( ‘[block id=”‘ . $block . ‘”]’ );
    get_template_part( ‘template-parts/footer/footer-absolute’ );
    } else {
    get_template_part( ‘template-parts/footer/footer’ );
    }
    }
    }

    Plugin Author sbouey

    (@sbouey)

    thanks for the code but can you put a screenshot of the Footer UX Block and the Falang Translate Post pagge.

    I know other users who are using the faltsome theme without problem.

    Stéphane

    Plugin Author sbouey

    (@sbouey)

    Hi,

    i have not found yet the solution but the falang filter for the_content() (in wp-content/plugins/falang/public/class-falang-public.php) is not launch
    it’s why even with you translate the ux builder post is not translated and the default value is displayed.

    I keep you informed when i have found why

    Stéphane

    Thread Starter Csilla Molnar

    (@csillamolnar)

    This is what I do:
    1-2. Example Footer UX Block with translation.
    3. Adding UX Block to Header in Personalize menu.

    It should be simple, but it doesn’t work :))

    1. https://ibb.co/0Y9pyLx
    2. https://ibb.co/5F3T72r
    3. https://ibb.co/6HqY3s1

    Thread Starter Csilla Molnar

    (@csillamolnar)

    Aaaaand, the same problem with the header blocks…

    Plugin Author sbouey

    (@sbouey)

    Here is the solution

    The problem is due when the ux block post is loaded , the filter for the content is not fired

    in the file
    wp-content/themes/flatsome/inc/post-types/post-type-ux-blocks.php
    line 135 change le code like this

    
    
    $the_post = get_post( $post_id, OBJECT, 'display' );
    		//sbou
    		//$html     = isset( $the_post ) ? $the_post->post_content : '';
            $post = $the_post;
            setup_postdata( $post );
            $html     = isset( $the_post ) ?  apply_filters( 'the_content', $the_post->post_content ) : '';
            wp_reset_postdata();
            //fin sbou

    `

    If you have contact with the flatsome team to make the change

    stéphane

    • This reply was modified 3 years ago by Yui.
    • This reply was modified 3 years ago by Yui. Reason: formatting
    Plugin Author sbouey

    (@sbouey)

    i receive your message notification during my mail.
    it will solve the header too.

    Stéphane

    Thread Starter Csilla Molnar

    (@csillamolnar)

    Thank you very much! It works!

    Plugin Author sbouey

    (@sbouey)

    Perfect,

    i put thead as resolved

    perhaps you can post a comment at the flatsome community to see if this change can be put in the next release.

    Stéphane

    Plugin Author sbouey

    (@sbouey)

    resolved

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘UX Block with Falang Translation Problem’ is closed to new replies.