-
AuthorPosts
-
December 22, 2021 at 9:02 pm #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
SantiagoDecember 23, 2021 at 1:02 pm #1333852Hey 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,
IsmaelDecember 23, 2021 at 8:23 pm #1333888Thnaks Ismael !!
Have a nice day!Santiago
December 24, 2021 at 6:25 am #1333927Hi,
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,
RikardJuly 4, 2023 at 9:45 am #1412402if 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');
July 4, 2023 at 10:22 am #1412404PS : 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.July 4, 2023 at 5:42 pm #1412438 -
AuthorPosts
- You must be logged in to reply to this topic.