• Resolved eissaadnan

    (@eissaadnan)


    Hello,

    I am trying to translate media from a divi theme, I am replacing the links as instructed on the weglot support page, but they are not being loaded, I think because of the Srcset that I am not being able to change as it goes back to the origin when the page is refreshed.

    Help Please

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Edson Galina Fortes

    (@glx77)

    Hi @eissaadnan ,

    hope you’re fine? Sorrry for the issue you’re facing. May you can try this filter (https://developers.weglot.com/wordpress/filters/translations-filters#use-case):

    add_filter( 'weglot_get_dom_checkers', 'custom_weglot_dom_check' );
    function custom_weglot_dom_check( $dom_checkers  ) { //$dom_checkers contains the list of all the class we are checking by default
    
    	class Div_Slide_Title extends Weglot\Parser\Check\Dom\AbstractDomChecker {
    		const DOM       = 'img'; //Type of tag you want to detect // CSS Selector
    		const PROPERTY  = 'srcset'; //Name of the attribute in that tag uou want to detect
    		const WORD_TYPE = Weglot\Client\Api\Enum\WordType::TEXT; //Do not change unless it's not text but a media URL like a .pdf file for example.
    	}
    	$dom_checkers[] = '\Div_Slide_Title'; //You add your class to the list because you want the parser to also detect it
    	return $dom_checkers ;
    }

    It would help you translate you’re media

    Don’t hesitate if you’ve other question

    Plugin Contributor Edson Galina Fortes

    (@glx77)

    Hi @eissaadnan ,

    hope you’re fine ? Let me know if it works on your side or if you need more help

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Media Translation not working’ is closed to new replies.