FacetWP Text Translations
-
When the page loads, Facet text (e.g. Dec 1 – Setting the Stage for COP29) does not get translated until you click one of the filters.
I tried using a function/script to trigger the translation on facetwp-loaded, but it doesn’t run because “Weglot is not defined”add_action( 'facetwp_scripts', function() {
?>
<script>
// Function to trigger Weglot translation
function triggerWeglotTranslation() {
if (typeof Weglot !== 'undefined') {
Weglot.translate();
}
}
// Run on initial FacetWP load
document.addEventListener('facetwp-loaded', function() {
triggerWeglotTranslation();
});
// Run on FacetWP refresh
document.addEventListener('facetwp-refresh', function() {
triggerWeglotTranslation();
});
</script>
<?php
}, 100 );Any ideas on how I can fix this or what I am doing wrong?
Thanks!The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.