{"id":957379,"date":"2015-04-22T08:42:02","date_gmt":"2015-04-22T15:42:02","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/"},"modified":"2015-04-24T12:41:34","modified_gmt":"2015-04-24T19:41:34","slug":"one-instance-of-event-falling-through-translation-filter","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/","title":{"rendered":"One instance of &quot;Event&quot; falling through translation filter"},"content":{"rendered":"<p>Hello. I found the following filter (text included below) on this forum to change all instances of &#8216;event&#8217; to &#8216;meeting&#8217;. I adjusted the filter to change it to &#8216;class&#8217;, as well as some other word changes. All works great, except on individual event pages in the meta details &#8216;Event Categories&#8217; still appears instead of &#8216;Class Categories&#8217; (screen shot attached below). I looked as best as I could to figure out why the filter isn&#8217;t catching this, but I&#8217;m stumped, and wondering if it has something to do the the degrading stuff that is mentioned. I&#8217;d also be ok to just not display the categories in this view, but can&#8217;t for the life of me figure our what to set to &#8220;display=none&#8221; to achieve this. <\/p>\n<p>Also (though this isn&#8217;t a translation issue) there is an unwanted line break in the time duration of the event hover view on the weekly grid (screen shot below). Would you be able to tell me how to have the duration not break after the start time in this view)?<\/p>\n<p>I&#8217;m using versions 3.9.2 of the Event Calendar, 3.9.3 of the Event Calendar Pro, and WordPress 4.1.2.<\/p>\n<p>Any and all will be help greatly appreciated!<\/p>\n<p><strong>Here is the filter I found on this forum (including my modifications) that I&#8217;ve put into the functions.php of my child theme:<\/strong><br \/>\n\/\/ This example replaces &#8220;Event&#8221; with &#8220;Class&#8221; in all Tribe Plugins text<\/p>\n<p>\/\/ See the codex to learn more about WP text domains:<br \/>\n\/\/ http:\/\/codex.wordpress.org\/Translating_WordPress#Localization_Technology<br \/>\n\/\/ Example Tribe domains: &#8216;tribe-events-calendar&#8217;, &#8216;tribe-events-calendar-pro&#8217;&#8230;<\/p>\n<p>add_filter(&#8216;gettext&#8217;, &#8216;theme_filter_text&#8217;, 10, 3);<\/p>\n<p>function theme_filter_text( $translations, $text, $domain ) {<br \/>\n \/\/ If this text domain starts with &#8220;tribe-&#8221;<br \/>\n if(strpos($domain, &#8216;tribe-&#8216;) === 0) {<br \/>\n \/\/ Replace upper case, lower case, singular, and plural<br \/>\n $text = str_replace(<br \/>\n \/\/ Text to search for<br \/>\n array(&#8216;Event&#8217;, &#8216;event&#8217;, &#8216;Events&#8217;, &#8216;events&#8217;, &#8216;Organizer&#8217;, &#8216;organizer&#8217;, &#8216;Venue&#8217;, &#8216;venue&#8217;, &#8216;passed&#8217;, &#8216;Recurring&#8217;),<\/p>\n<p> \/\/ Text to replace it with &#8212; change this for your needs<br \/>\n array(&#8216;Class&#8217;, &#8216;class&#8217;, &#8216;Classes&#8217;, &#8216;classes&#8217;, &#8216;Instructor&#8217;, &#8216;instructor&#8217;, &#8216;Location&#8217;, &#8216;location&#8217;, &#8216;finished&#8217;, &#8216;Weekly&#8217;),<br \/>\n $text<br \/>\n );<\/p>\n<p> }<\/p>\n<p> return $text;<br \/>\n}<\/p>\n<p>add_filter(&#8216;ngettext&#8217;, &#8216;theme_filter_ntext&#8217;, 10, 5);<\/p>\n<p>function theme_filter_ntext( $translation, $single, $plural, $number, $domain ) {<br \/>\n \/\/ If this text domain starts with &#8220;tribe-&#8221;<br \/>\n if(strpos($domain, &#8216;tribe-&#8216;) === 0) {<br \/>\n \/\/ Replace upper case, lower case, singular, and plural<br \/>\n if( $number &gt; 1 ) {<br \/>\n $plural = str_replace(<br \/>\n \/\/ Text to search for<br \/>\n array(&#8216;Events&#8217;, &#8216;events&#8217;),<\/p>\n<p> \/\/ Text to replace it with &#8212; change this for your needs<br \/>\n array(&#8216;Classes&#8217;, &#8216;classes&#8217;),<br \/>\n $plural<br \/>\n );<\/p>\n<p> return $plural;<br \/>\n } else {<br \/>\n $single = str_replace(<br \/>\n \/\/ Text to search for<br \/>\n array(&#8216;Event&#8217;, &#8216;event&#8217;, &#8216;Organizer&#8217;, &#8216;organizer&#8217;, &#8216;Venue&#8217;, &#8216;venue&#8217;, &#8216;passed&#8217;, &#8216;Recurring&#8217;),<\/p>\n<p> \/\/ Text to replace it with &#8212; change this for your needs<br \/>\n array(&#8216;Class&#8217;, &#8216;class&#8217;, &#8216;Instructor&#8217;, &#8216;instructor&#8217;, &#8216;Location&#8217;, &#8216;location&#8217;, &#8216;finished&#8217;, &#8216;Weekly&#8217;),<br \/>\n $single<br \/>\n );<\/p>\n<p> return $single;<br \/>\n }<br \/>\n }<br \/>\n}<\/p>\n<p><strong>Here is a screen shot of where the word &#8216;Event&#8217; is not switching out to &#8216;Class&#8217;:<\/strong><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.16.34-AM.png\" alt=\"'Event' should be 'Class'\" \/><\/p>\n<p><strong>Here is a screen shot of the unwanted line break in the time duration of the hover view<\/strong><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.34.32-AM.png\" alt=\"unwanted line break in duration\" \/><\/p>\n","protected":false},"template":"","class_list":["post-957379","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>One instance of &quot;Event&quot; falling through translation filter -<\/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\/one-instance-of-event-falling-through-translation-filter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"One instance of &quot;Event&quot; falling through translation filter -\" \/>\n<meta property=\"og:description\" content=\"Hello. I found the following filter (text included below) on this forum to change all instances of &#8216;event&#8217; to &#8216;meeting&#8217;. I adjusted the filter to change it to &#8216;class&#8217;, as well as some other word changes. All works great, except on individual event pages in the meta details &#8216;Event Categories&#8217; still appears instead of &#8216;Class [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-04-24T19:41:34+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.16.34-AM.png\" \/>\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\/one-instance-of-event-falling-through-translation-filter\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/\",\"name\":\"One instance of &quot;Event&quot; falling through translation filter -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.16.34-AM.png\",\"datePublished\":\"2015-04-22T15:42:02+00:00\",\"dateModified\":\"2015-04-24T19:41:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#primaryimage\",\"url\":\"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.16.34-AM.png\",\"contentUrl\":\"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.16.34-AM.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#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\":\"One instance of &quot;Event&quot; falling through translation filter\"}]},{\"@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":"One instance of &quot;Event&quot; falling through translation filter -","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\/one-instance-of-event-falling-through-translation-filter\/","og_locale":"en_US","og_type":"article","og_title":"One instance of &quot;Event&quot; falling through translation filter -","og_description":"Hello. I found the following filter (text included below) on this forum to change all instances of &#8216;event&#8217; to &#8216;meeting&#8217;. I adjusted the filter to change it to &#8216;class&#8217;, as well as some other word changes. All works great, except on individual event pages in the meta details &#8216;Event Categories&#8217; still appears instead of &#8216;Class [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/","article_modified_time":"2015-04-24T19:41:34+00:00","og_image":[{"url":"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.16.34-AM.png","type":"","width":"","height":""}],"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\/one-instance-of-event-falling-through-translation-filter\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/","name":"One instance of &quot;Event&quot; falling through translation filter -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#primaryimage"},"image":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#primaryimage"},"thumbnailUrl":"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.16.34-AM.png","datePublished":"2015-04-22T15:42:02+00:00","dateModified":"2015-04-24T19:41:34+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#primaryimage","url":"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.16.34-AM.png","contentUrl":"http:\/\/www.ironwolftraining.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-22-at-11.16.34-AM.png"},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/one-instance-of-event-falling-through-translation-filter\/#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":"One instance of &quot;Event&quot; falling through translation filter"}]},{"@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\/957379","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":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/957379\/revisions"}],"predecessor-version":[{"id":957655,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/957379\/revisions\/957655"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=957379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}