Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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?

    #1031877

    so 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 5 years, 11 months ago by Guenni007.
    #1031880

    by the way the binding word is often defined as a separator string
    $sep or $separator – and on different cases the separator is defined individually.

    #1031975

    Hi,

    Thanks for helping out @guenni007, did you try that out @tammiviestinta?

    Best regards,
    Rikard

    #1032195
    #1032470

    Hi,
    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.
    Heli

    #1032537

    Hi Heli,

    Thank for the update, we’ll keep the thread open until you know which route you want to take.

    Best regards,
    Rikard

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.