-
AuthorPosts
-
November 9, 2018 at 6:43 pm #1031759
Hi,
How could I translate/replace the heading in Events Calender: on monthly view there is a heading Events for November 2018. In Finnish we don’t use any word in place of the word “for”. Can we replace it with a hyphen or common – or nothing? Like “Tapahtumat – marraskuu 2018”. Events and months are already in Finnish, but that “for” is not good. “For” is not found in Loco Translate… Where that heading comes from?
November 10, 2018 at 12:59 am #1031877so now there is: Tapahtumat for marraskuu 2018?
This is certainly a composite form in the source code.
( By this I mean that the word “event” is translated individually followed by a binding word and then the months are translated individually and the whole thing is just put together. )
Therefore it would be unwise to replace the “for” with a hyphen in general. Then all occurrences of “for” on your whole website would be replaced.But you can try this in your functions.php of your child-theme:
function my_text_strings ( $translated_text, $text, $domain ){ switch ( $translated_text ){ case 'for tammikuu': $translated_text = __( '- tammikuu', $domain ); break; case 'for helmikuu': $translated_text = __( '- helmikuu', $domain ); break; case 'for maaliskuu': $translated_text = __( '- maaliskuu', $domain ); break; case 'for huhtikuu': $translated_text = __( '- huhtikuu', $domain ); break; case 'for toukokuu': $translated_text = __( '- toukokuu', $domain ); break; case 'for kesäkuu': $translated_text = __( '- kesäkuu', $domain ); break; case 'for heinäkuu': $translated_text = __( '- heinäkuu', $domain ); break; case 'for elokuu': $translated_text = __( '- elokuu', $domain ); break; case 'for syyskuu': $translated_text = __( '- syyskuu', $domain ); break; case 'for lokakuu': $translated_text = __( '- lokakuu', $domain ); break; case 'for marraskuu': $translated_text = __( '- marraskuu', $domain ); break; case 'for joulukuu': $translated_text = __( '- joulukuu', $domain ); break; } return $translated_text; } add_filter('gettext', 'my_text_strings', 20, 3);
you have to do that for all 12 cases ( Month )
maybe this could work- This reply was modified 6 years ago by Guenni007.
November 10, 2018 at 1:12 am #1031880by the way the binding word is often defined as a separator string
$sep or $separator – and on different cases the separator is defined individually.November 10, 2018 at 10:08 am #1031975November 11, 2018 at 11:06 am #1032195maybe this could help : https://theeventscalendar.com/knowledgebase/altering-or-removing-titles-on-calendar-views/
November 12, 2018 at 8:39 am #1032470Hi,
Thank you for the advices! I haven’t tried anything yet. I need to think what to do: try that functions.php changes or remove titles.
HeliNovember 12, 2018 at 10:57 am #1032537 -
AuthorPosts
- You must be logged in to reply to this topic.