• Resolved wilsmithwp

    (@wilsmithwp)


    Hi there,
    Sorry, got another question.

    I have made a filter with city names, with checkboxes.
    I use Gtranslate (i know, bad stuff) to translate from FR to EN-GB.
    Unfortunately, it translates the city names and even leaves some options blank.
    When i switch back to French, all is ok again.

    So i want to add a class=”no translate” to
    A. to 1 specific variable, like the cities.
    or
    B. the entire filter

    I should be just adding that class somewhere, but just cannot find where to put it.

    Thanx again.
    Wil

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author paradigmatools

    (@paradigmatools)

    Hello Wil

    all filter elements are formed in JS

    In file – \wp-content\plugins\avalon23-products-filter-for-woocommerce\assets\js\filter.js – add code – https://share.stackovergo.com/image/i20220120140514.png

    clear all cache and Ctrl+F5 and do a test

    Thread Starter wilsmithwp

    (@wilsmithwp)

    Hello there,
    Thanx for you time again! ((-;

    Nope,
    It was line 1117
    label.className = ‘avalon23_radio_checkbox_container skiptranslate notranslate’;

    That did the trick.
    The titles get translated but the content not, so that is ok for now.
    Brilliant!!!!

    Should i secure filter.js in my childtheme? Can i copy Avelon23 to my childtheme to secure some codes?

    Plugin Author paradigmatools

    (@paradigmatools)

    Hello

    Unfortunately, this code cannot be moved to a child theme. You should make this change after every update.

    OR better try to use this code:

    document.addEventListener('avalon23-filter-is-drawn', e => {
    	let all_labels = e.detail.filter_elements.querySelectorAll('.avalon23_radio_checkbox_container');
    	for (let i = 0; i < all_labels.length; i++) {
    	    all_labels[i].classList.add('notranslate');
    	}
    
        }, false);

    you can paste it into any JS file

    Thread Starter wilsmithwp

    (@wilsmithwp)

    Thank you very much!
    Have a great day.
    Wil

    Plugin Author paradigmatools

    (@paradigmatools)

    Hello Wil
    Welcome;)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add class=”notranslate” to filters’ is closed to new replies.