• Resolved baobabcommunication

    (@baobabcommunication)


    Hello everyone,

    I’m using Polylang and I’d like to know if there’s the possibility to translate the string once the url changes.

    I noticed that the filter layout doesn’t seem to be translated ready

    <span style="color: #d4d4d4;">               
    </span><span style="color: #dcdcaa;">echo</span><span style="color: #d4d4d4;"> </span><span style="color: #ce9178;">'<li class="filter-item">                     
    <a class="filter-link all active" href="#" data-selected="all" data-termid="'</span><span style="color: #d4d4d4;">. </span><span style="color: #dcdcaa;">esc_attr</span><span style="color: #d4d4d4;">(</span><span style="color: #9cdcfe;">$ymc_terms</span><span style="color: #d4d4d4;">) .</span><span style="color: #ce9178;">'">'</span><span style="color: #d4d4d4;">. </span><span style="color: #dcdcaa;">esc_html__</span><span style="color: #d4d4d4;">(</span><span style="color: #9cdcfe;">$show_all</span><span style="color: #d4d4d4;">) .</span><span style="color: #ce9178;">'</a></li>'</span><span style="color: #d4d4d4;">;</span>
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author YMC

    (@wssoffice21)

    Hello!
    All phrases in the plugin provide translation capabilities. Translation constructs are used, for example: (__(‘All’,’ymc-smart-filter’). Please specify where in the plugin you cannot translate the phrase?

    Plugin Author YMC

    (@wssoffice21)

    Thanks please rate our plugin

    • This reply was modified 1 year, 4 months ago by YMC.
    Thread Starter baobabcommunication

    (@baobabcommunication)

    Thanks for the quick response, it’s in this page.

    As u can see in the english side it’s not translated. I’ve used a custom layout but for displaying the content, not the filter such as:

        $layout_mio .= '<article class="ymc-post-$layout_mio1 post- 19 post-item">';
    
        $layout_mio .= '    <figure class="media">';
    
        $layout_mio .= '        <img width="901" height="1600" src="' . $link . '" class="attachment-full size-full wp-post-image" alt="' . $title . '" loading="lazy">';
    
        $layout_mio .= '    </figure>    <div class="category">';
    
        $layout_mio .= '    </div>';
    
        $layout_mio .= '    <header class="title">Clematis montana “Mayleen”</header>';
    
        $layout_mio .= '    <span class="date">';
    
        $layout_mio .= '        <i class="far fa-calendar-alt"></i> 17, Giu 2020 </span>';
    
        $layout_mio .= '    <span class="author">';
    
        $layout_mio .= '        <i class="far fa-user"></i> sviluppo </span>';
    
        $layout_mio .= '    <div class="excerpt"></div>';
    
        $layout_mio .= '    <div class="read-more">';
    
        $layout_mio .= '        <a class="btn btn-read-more" target="_blank" >Read More</a>';
    
        $layout_mio .= '    </div>';
    
        $layout_mio .= '</article>';
    Plugin Author YMC

    (@wssoffice21)

    You will have to use the WordPress function to translate phrases, for example:

    $layout_mio .= '<header class="title">
    (__(‘Clematis montana Mayleen’,’ymc-smart-filter’).
    </header>';

    This is custom code and all phrases must be wrapped in the WordPress translation functions. Then these phrases should appear in the translations of the Polylang plugin

    The filter plugin layout uses the taxonomy terms of WordPress itself. Perhaps you should translate terms within taxonomies. Polylang should provide this ability to translate categories. The plugin displays only ready-made terms from the database

    • This reply was modified 1 year, 4 months ago by YMC.
    • This reply was modified 1 year, 4 months ago by YMC.
    • This reply was modified 1 year, 4 months ago by YMC.
    Thread Starter baobabcommunication

    (@baobabcommunication)

    All right, but for the filters? I’m using the Dropdown Filter as layout

    You said that it’s automatically translated

    Plugin Author YMC

    (@wssoffice21)

    All terms that are displayed inside filters, including the dropdown filter, are extracted from the list of terms that are specified inside categories (taxonomies). You should translate these terms manually in the WordPress admin panel using plugins (WPML or Polylang) and then these translated terms will be displayed on the page. Perhaps you should use multiple filter shortcodes on each translation page. For example, for the English version of the page there will be one filter and for the Italian version of the page there will be another filter. This way you will get different meanings for terms. I hope this method can solve your task.

    This construction __(‘Clematis montana Mayleen’,’ymc-smart-filter’) only prepares phrases for translations. And you will need to translate manually in any case

    • This reply was modified 1 year, 4 months ago by YMC.
    • This reply was modified 1 year, 4 months ago by YMC.
    Thread Starter baobabcommunication

    (@baobabcommunication)

    Thanks for the help, as you can see in the title I’m using Polylang.

    I’ve added a new filter shortcode so to make it work for the english version (but it’s not translating).

    I’ve already translated all the taxonomies one by one, but I see Smart Filter looking for the IDs of the Italian ones, not the english ones.

    UPDATE: After checking the taxonomies

    I’ve noticed that finds also the translated ones, so I do actually need to create a different filter as you proposed. I expected it to be automatic, but I’ll drill in it.

    Thanks

    Plugin Author YMC

    (@wssoffice21)

    We are glad that you were able to solve your task. We will be grateful for your feedback! Thanks

    • This reply was modified 1 year, 4 months ago by YMC.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Polylang translation request’ is closed to new replies.