{"id":1113398,"date":"2016-05-11T12:50:44","date_gmt":"2016-05-11T19:50:44","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/"},"modified":"2016-05-27T09:35:05","modified_gmt":"2016-05-27T16:35:05","slug":"french-dates-and-times","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/","title":{"rendered":"French Dates and Times"},"content":{"rendered":"<p>I have had to tweak the core code of The Events Calendar and Events Calendar Pro to get French dates on a WPML bilingual enabled website to display properly. Here&#8217;s what I did, and I want to know if there is an easier less hacky way to do this (I have to remember to copy over the files whenever the events calendar is updated). <\/p>\n<p>In <strong>theeventscalendar\/src\/functions\/template-tags\/general.php<\/strong>:<\/p>\n<p>Modify <strong>function tribe_get_event_categories<\/strong>:<\/p>\n<pre><code>\n\t\t\tif (ICL_LANGUAGE_CODE == &#039;fr&#039;) {\n\t\t\t\t$label = sprintf(\n\t\t\t\t\t_nx( &#039;Cat\u00e9gorie d\u2019\u00e9v\u00e9nements &#039;, &#039;Cat\u00e9gories d\u2019\u00e9v\u00e9nements &#039;, substr_count( $categories, &#039;&lt;a href&#039; ), &#039;taxonomie&#039;, &#039;the-events-calendar&#039; ),\n\t\t\t\t\t$events_label_singular\n\t\t\t\t); }\n\t\t\telse {\n\n\t\t\t\t$label = sprintf(\n\t\t\t\t\t_nx( &#039;%s Category&#039;, &#039;%s Categories&#039;, substr_count( $categories, &#039;&lt;a href&#039; ), &#039;category list label&#039;, &#039;the-events-calendar&#039; ),\n\t\t\t\t\t$events_label_singular\n\t\t\t\t);\n\t\t\t}<\/code><\/pre>\n<p>Modify <strong>function tribe_events_event_schedule_details<\/strong>:<\/p>\n<pre><code>\t\t$time_format = tribe_get_time_format(); \n\n\t\tif (ICL_LANGUAGE_CODE == &#039;fr&#039;) {\n\t\t\t$datetime_separator = &#039;, de &#039;;\n\t\t\t$time_range_separator = &#039; \u00e0 &#039;;\n\t\t} else {\n\t\t\t$datetime_separator = tribe_get_option( &#039;dateTimeSeparator&#039;, &#039;, &#039; );\n\t\t\t$time_range_separator = tribe_get_option( &#039;timeRangeSeparator&#039;, &#039; - &#039; );\n\t\t}\n<\/code><\/pre>\n<p>In <strong>theeventscalendar\/common\/src\/functions\/template-tags\/general.php<\/strong>:<\/p>\n<p>Modify <strong>function tribe_get_date_format<\/strong>:<\/p>\n<pre><code>if (ICL_LANGUAGE_CODE == &#039;fr&#039;) {\n\t\t\t\tif ( $with_year ) {\n\t\t\t\t\t$format = &#039;j F Y&#039;;\n\t\t\t\t\t} else {\n\t\t\t\t\t$format = &#039;j F&#039;;\n\t\t\t\t\t}  \n\t\t\t\t} else {\n\t\t\t\t\tif ( $with_year ) {\n\t\t\t\t\t$format = tribe_get_option( &#039;dateWithYearFormat&#039;, get_option( &#039;date_format&#039; ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t$format = tribe_get_option( &#039;dateWithoutYearFormat&#039;, &#039;F j&#039; );\n\t\t\t\t}\n\t\t\t}<\/code><\/pre>\n<p>Modify <strong>function tribe_get_datetime_format<\/strong>:<\/p>\n<pre><code>if (ICL_LANGUAGE_CODE == &#039;fr&#039;) {\n\t\t\t\t$separator = (array) str_split( tribe_get_option( &#039;dateTimeSeparator&#039;, &#039;, &#039; ) );\n\t\t\t\t$format = &#039;j F&#039;;\n\t\t\t\t$format .= ( ! empty( $separator ) ? &#039;\\\\&#039; : &#039;&#039; ) . implode( &#039;\\\\&#039;, $separator );\n\t\t\t\t$format .= &#039;G \\h i&#039;;\n\t\t\t} else {\n\t\t\t\t$separator = (array) str_split( tribe_get_option( &#039;dateTimeSeparator&#039;, &#039;, &#039; ) );\n\t\t\t\t$format = tribe_get_date_format( $with_year );\n\t\t\t\t$format .= ( ! empty( $separator ) ? &#039;\\\\&#039; : &#039;&#039; ) . implode( &#039;\\\\&#039;, $separator );\n\t\t\t\t$format .= get_option( &#039;time_format&#039; );\n\t\t\t}<\/code><\/pre>\n<p>Modify <strong>function tribe_get_time_format( )<\/strong>:<\/p>\n<pre><code>if (ICL_LANGUAGE_CODE == &#039;fr&#039;) {\n\t\t\t\t$format = &#039;G \\h i&#039;;\n\t\t\t} else {\n\t\t\t\t$format = get_option( &#039;time_format&#039; );\n\t\t\t}<\/code><\/pre>\n<p>In <strong>theeventscalendar\/src\/views\/modules\/meta\/details.php<\/strong>:<\/p>\n<p>Replace <strong>get_option( &#8216;time_format&#8217; );<\/strong> with: <\/p>\n<pre><code>$time_format = tribe_get_time_format(); \n\nif (ICL_LANGUAGE_CODE == &#039;fr&#039;) {\n\t$time_range_separator = &#039; \u00e0 &#039;;\n} else {\n\t$time_range_separator = tribe_get_option( &#039;timeRangeSeparator&#039;, &#039; - &#039; );\n}\n<\/code><\/pre>\n<p>The last file can be moved to my child theme folder, but the general template-tag files cannot.<\/p>\n","protected":false},"template":"","class_list":["post-1113398","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>French Dates and Times -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"French Dates and Times -\" \/>\n<meta property=\"og:description\" content=\"I have had to tweak the core code of The Events Calendar and Events Calendar Pro to get French dates on a WPML bilingual enabled website to display properly. Here&#8217;s what I did, and I want to know if there is an easier less hacky way to do this (I have to remember to copy [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-05-27T16:35:05+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/\",\"name\":\"French Dates and Times -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-05-11T19:50:44+00:00\",\"dateModified\":\"2016-05-27T16:35:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Additional Help\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/others\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Translations\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/others\/translation\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"French Dates and Times\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"French Dates and Times -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/","og_locale":"en_US","og_type":"article","og_title":"French Dates and Times -","og_description":"I have had to tweak the core code of The Events Calendar and Events Calendar Pro to get French dates on a WPML bilingual enabled website to display properly. Here&#8217;s what I did, and I want to know if there is an easier less hacky way to do this (I have to remember to copy [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/","article_modified_time":"2016-05-27T16:35:05+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/","name":"French Dates and Times -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-05-11T19:50:44+00:00","dateModified":"2016-05-27T16:35:05+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/french-dates-and-times\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Additional Help","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/others\/"},{"@type":"ListItem","position":4,"name":"Translations","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/others\/translation\/"},{"@type":"ListItem","position":5,"name":"French Dates and Times"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1113398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1113398\/revisions"}],"predecessor-version":[{"id":1113405,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1113398\/revisions\/1113405"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1113398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}