Home › Forums › Calendar Products › Events Calendar PRO › Changing the date format per language in WPML
- This topic has 15 replies, 2 voices, and was last updated 8 years, 7 months ago by
Gaspar Baksa.
-
AuthorPosts
-
September 6, 2017 at 3:52 am #1345324
Gaspar Baksa
ParticipantHi,
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,
GasparSeptember 6, 2017 at 8:38 pm #1345781Geoff B.
MemberGood 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):
- String Translation
- Translation Management
Could you give the following a read and see if that helps:
- https://wpml.org/forums/topic/date-formatting-issue/
- https://wpml.org/forums/topic/how-to-translate-the-date-format/
Let me know how that goes.
Best regards,
Geoff B.
September 7, 2017 at 1:27 am #1345859Gaspar Baksa
ParticipantHi 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,
GasparSeptember 7, 2017 at 11:46 pm #1346457Geoff B.
MemberGood 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:
- Clearing WPML cache
- Click on the different buttons in the first section to “force” language assignment
- Re-save your permalinks
- Clear any cache from a caching plugin (if any)
Let me know if that helps.
Have a great day!
Geoff B.
September 9, 2017 at 3:15 am #1346990Gaspar Baksa
ParticipantHi 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?
September 11, 2017 at 9:55 pm #1347849Geoff B.
MemberThis reply is private.
September 19, 2017 at 10:18 am #1351357Gaspar Baksa
ParticipantThis reply is private.
September 19, 2017 at 11:54 pm #1351700Geoff B.
MemberThis reply is private.
September 20, 2017 at 12:06 am #1351704Gaspar Baksa
ParticipantThis reply is private.
September 20, 2017 at 10:32 pm #1352414Geoff B.
MemberThis reply is private.
September 20, 2017 at 11:09 pm #1352419Gaspar Baksa
ParticipantThis reply is private.
September 22, 2017 at 3:36 pm #1353698Geoff B.
MemberThis reply is private.
September 22, 2017 at 4:18 pm #1353704Geoff B.
MemberGood 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.
September 22, 2017 at 11:07 pm #1353771Gaspar Baksa
ParticipantHi Geoff,
Thank you, it worked out!
The link on the bottom was so small I even didn’t notice it 🙁Bests,
GasparSeptember 25, 2017 at 9:11 am #1354317Geoff B.
MemberGood 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.
-
AuthorPosts
- The topic ‘Changing the date format per language in WPML’ is closed to new replies.
