• Resolved gandzamen

    (@gandzamen)


    Hi,

    I met with a theme option’s parameters translating problem. I’m using https://inspirythemesdemo.com/realhomes/ theme, and there are theme option page where I define name of Advanced Search Form title – Find your home. How it can be translated to another languages?
    The same problem when I have a link to search result page, how specify link to another result pages (for corresponding language)?
    I copied a piece of code where variables are assigned with values returned by get_option funtcion.

    <?php
    global $theme_search_url;
    $theme_search_url = get_option('theme_search_url');
    
    global $theme_search_fields;
    $theme_search_fields= get_option('theme_search_fields');
    
    if( !empty($theme_search_url) && !empty($theme_search_fields) && is_array($theme_search_fields) ):
        ?>
        <section class="advance-search ">
            <?php
            $home_advance_search_title= get_option('theme_home_advance_search_title');
            if(!empty($home_advance_search_title)){
                ?><h3 class="search-heading"><i class="fa fa-search"></i><?php echo $home_advance_search_title; ?></h3><?php
            }
            get_template_part('template-parts/search-form');
            ?>
        </section>
        <?php
    endif;
    ?>

    https://www.ads-software.com/plugins/ceceppa-multilingua/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Alessandro Senese

    (@ceceppa)

    Hi,
    sorry for delay…
    You can use something like this:

    cml_translate( $home_advance_search_title );

    and store the translation in “Ceceppa Multilingua” -> “My translations” table

    Thread Starter gandzamen

    (@gandzamen)

    Hi,

    cml_translate( $home_advance_search_title );
    I should be put in php file? Or directly in My translations table?

    Plugin Author Alessandro Senese

    (@ceceppa)

    Hi,
    in the php file just below this line:

    $home_advance_search_title= get_option('theme_home_advance_search_title');
    Thread Starter gandzamen

    (@gandzamen)

    I did how you wrote but nothing. In My translation table I added new row and write String – in latvian (the same value as in theme option page), and two translations: in english and russian. In the result, I see only value in latvian. Probably I did something wrong, right?

    Thread Starter gandzamen

    (@gandzamen)

    I added also code line in php file.

    Plugin Author Alessandro Senese

    (@ceceppa)

    Ok, remove the line and find up this one:

    <?php echo $home_advance_search_title; ?>

    and change in:

    <?php echo do_shortcode( $home_advance_search_title ) ?>

    after you’ll be able to use shortcode in the fields and so you can write something like this:

    `
    [:en]Put your text in English here[/:it][:ru]Russian text[/:ru]

    Thread Starter gandzamen

    (@gandzamen)

    Hey ??

    Your tip help me, i’m so glad!! ??

    But in the footer i have Copyright, also value is assigned through Theme option, but in the php file there is proceed a bit different

    <div class="span6">
                                <?php
                                $copyright_text = get_option('theme_copyright_text');
                                echo ( $copyright_text ) ? '<p class="copyright">'.$copyright_text.'</p>' : '';
                                ?>
                            </div>

    So in this case do_shortcode not help. Why? Because variable are in the brackets?

    Thread Starter gandzamen

    (@gandzamen)

    The issue has been resolved.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can't translate Theme options parameters’ is closed to new replies.