Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1333797

    Hi!
    I need to translate countdown information (days, hours, minutes, seconds)
    Not the entire site, but just these information.

    …..My website text is fully english, but countdown info is in spanish.

    Could you help me please?

    Regards
    Santiago

    #1333852

    Hey enfold,

    Thank you for the inquiry.

    Did you set the site language to Spanish? You can set it back to English in the Settings > General > Site Language options. You can also use this plugin to translate a specific text or string.

    // https://wordpress.org/plugins/say-what/

    Best regards,
    Ismael

    #1333888

    Thnaks Ismael !!
    Have a nice day!

    Santiago

    #1333927

    Hi,

    Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1412402

    if you like to set it for only that element on a default english page -( and not for the whole page)
    Setting only the lang attribute for that Element will be not enough.
    But you can set for that specific Element the attributes separately – give to the animated countdown element a custom class or like i did a unique ID
    f.e.: spanish
    then put this to your 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');

    see: https://enfold.webers-webdesign.de/3-columns/

    #1412404

    PS : i do not know if we could use the filter: language_attributes for only one element.
    You can use this filter to change the output for a specific page even though the entire installation is set to a different language.

    #1412438

    Hi,

    Thanks for helping out @guenni007 :-)

    Best regards,
    Rikard

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