Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1445350

    Hi Enfold
    How do I change language in the animated countdown ?

    Alan ;)

    #1445356

    if the html lang attribute changes to the new language – the labels are not translated?
    does your lang plugin set a html lang attribute?

    _________
    anyway:
    give a unique ID to your countdown element f.e.: spanish

    then follow the exemple here: https://enfold.webers-webdesign.de/3-columns/

    for child-theme functions.php:

    function set_spanish_translations(){
    ?>
    <script>
    window.addEventListener("DOMContentLoaded", function () { 
    	(function($) {       
    		$('#spanish').attr('lang', 'es-ES');
    		$('#spanish .av-countdown-years .av-countdown-time-label').attr({'data-label': 'Año', 'data-label-multi': 'Años'});
    		$('#spanish .av-countdown-months .av-countdown-time-label').attr({'data-label': 'Mes','data-label-multi': 'Meses'});
    		$('#spanish .av-countdown-weeks .av-countdown-time-label').attr({'data-label': 'Semana','data-label-multi': 'Semanas'});
    		$('#spanish .av-countdown-days .av-countdown-time-label').attr({'data-label': 'Día','data-label-multi': 'Días'});
    		$('#spanish .av-countdown-hours .av-countdown-time-label').attr({'data-label': 'Hora','data-label-multi': 'Horas'});
    		$('#spanish .av-countdown-minutes .av-countdown-time-label').attr({'data-label': 'Minuto','data-label-multi': 'Minutos'});
    		$('#spanish .av-countdown-seconds .av-countdown-time-label').attr({'data-label': 'Segundo','data-label-multi': 'Segundos'});
    	}(jQuery)); 
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'set_spanish_translations');

    it differs between data-label and data-label-multi – for singular and plural form of the Units

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.