Dates translation

Pending
RoyalTickets - Events Booking WordPress Theme RoyalTickets - Events Booking WordPress Theme October 01, 2020
Login to reply
Alex Gurghis Support Agent
4 years ago

Hey Livio,

Yes, sure you can translate all the dates in the theme. You add that in the main theme folder -> assets -> js -> global.js file.

Livio Siano
4 years ago

Where do i have to put that strings ?

Livio Siano
4 years ago

Isn't it possible to translate the dates in all the theme ?

Regards,


*Livio Siano*
Webdesigner || Webdeveloper || Photography || Videomaking
www.livioleesiano.it || www.blueboxcommunication.it

Alex Gurghis Support Agent
4 years ago

Hey Livio,

You can translate the dates like this:

$('.js-input-date').flatpickr({
  dateFormat: 'm.d.Y',
  locale: {
    firstDayOfWeek: 1,
    months: {
      shorthand: ['Янв', 'Фев', 'Март', 'Апр', 'Май', 'Июнь', 'Июль', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],
      longhand: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
    },
  },
});

This for date picker fields for php fields you can translate like this:

<?php setlocale(LC_ALL, 'fr_FR'); echo $date = date('j', $date_to_show); ?> <?php echo $date = utf8_encode(strftime('%B', $date_to_show)); ?>

Let me know if you can do it or I can help you to achieve it.

With regards,

Alex

Livio Siano
4 years ago

Hi, how can i translate the dates ? January -> gennaio and so on ?