Changing the date format per language in WPML

Home Forums Calendar Products Events Calendar PRO Changing the date format per language in WPML

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1345324
    Gaspar Baksa
    Participant

    Hi,

    I want to make a filter for displaying the dates in the correct language format in the Italian and German language generated by WPML – to put the number of the day before the month – via the php function tribe_events_event_schedule_details( );
    How is it possible to plug in the function with the conditional if(ICL_LANGUAGE_CODE==’de’) WPML function?

    Can you please help me how it is done?

    Thanks and Bests,
    Gaspar

    #1345781
    Geoff B.
    Member

    Good evening Gaspar and welcome back!

    This is a great question.

    The good news is that I do not believe that you need to actually come up with a filter to achieve that. WPML’s suite should allow you to do just that.

    However, I believe you are currently missing 2 modules for that (and for true compatibility with our the Events Calendar plugins):

    1. String Translation
    2. Translation Management

    Could you give the following a read and see if that helps:

    1. https://wpml.org/forums/topic/date-formatting-issue/
    2. https://wpml.org/forums/topic/how-to-translate-the-date-format/

    Let me know how that goes.

    Best regards,

    Geoff B.

    #1345859
    Gaspar Baksa
    Participant

    Hi Geoff,
    Thank you for pointing out to the solution. I installed the String translation and Translation management and used the solution from the first link (the second didn’t work out)
    The String translation now shows the Date Format option, but at the front-end there is no change 🙁
    Please see the screenshot.
    Should I change also something else in Event Calendar, so it works out?
    Bests,
    Gaspar

    #1346457
    Geoff B.
    Member

    Good evening Gaspar,

    Thank you for writing back.

    Sometimes things can get sticky with WPML.
    What I mean by that is that you really need to force a refresh of things for all updates to be performed.

    Before anything a database backup is always recommended.

    Head over to WPML > Support > Troubleshooting page.

    Once you are there, you should see several cleanup buttons. I would recommend:

    1. Clearing WPML cache
    2. Click on the different buttons in the first section to “force” language assignment
    3. Re-save your permalinks
    4. Clear any cache from a caching plugin (if any)

     

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1346990
    Gaspar Baksa
    Participant

    Hi Geoff

    Unfortunately the cache cleaning didn’t help 🙁

    Can you check please if I did the steps correctly?

    put the String Translation enabler in functions.php, uploaded to the server

    function translate_date_format($format) {
    if (function_exists(‘get_the_date’)) {
    icl_register_string(‘Formats’, ‘Date Format’, $format);
    $format = icl_translate(‘Formats’, ‘Date Format’, $format);
    }
    return $format;
    }
    add_filter(‘option_date_format’, ‘translate_date_format’);

    assign Date Format Domain translation string for DE, and ITA, check Translation Ready and saved

    j F, Y

    Should it work with these settings in place?

    #1347849
    Geoff B.
    Member

    This reply is private.

    #1351357
    Gaspar Baksa
    Participant

    This reply is private.

    #1351700
    Geoff B.
    Member

    This reply is private.

    #1351704
    Gaspar Baksa
    Participant

    This reply is private.

    #1352414
    Geoff B.
    Member

    This reply is private.

    #1352419
    Gaspar Baksa
    Participant

    This reply is private.

    #1353698
    Geoff B.
    Member

    This reply is private.

    #1353704
    Geoff B.
    Member

    Good evening Gaspar,

    It took a while, but I found the solution. You need to use the little known “Translate texts in admin screens »” link located at the very bottom of the *string translation” menu https://wpml.org/forums/topic/cannot-translate-date-format/

    More specifically, look for tribe_events_calendar_options and hit the “expand” button.
    You should now be able to translate all date formats.

    Have a good weekend,

    Geoff B.

    #1353771
    Gaspar Baksa
    Participant

    Hi Geoff,

    Thank you, it worked out!
    The link on the bottom was so small I even didn’t notice it 🙁

    Bests,
    Gaspar

    #1354317
    Geoff B.
    Member

    Good afternoon Gaspar,

    I am glad this worked out for you!
    On the plus side, that also helped to update our knowledge base: https://theeventscalendar.com/knowledgebase/setting-up-the-events-calendar-with-wpml/

    You are welcome back in our support forums any time 🙂

    For now, I am going to close this thread.

    Have a great week!

    Geoff B.

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Changing the date format per language in WPML’ is closed to new replies.