• Resolved lge987

    (@lge987)


    The title above calendar grid is “Events for September 2019” in english.
    In polish it says “Wydarzenia for Styczeń 2019” which is completely wrong.
    The phrase shall be translated as whole not just going word by word.
    In polish nouns decline so it is not enough to translate just the name of the month but also in a proper form.
    e.g in January it is “Wydarzenia w styczniu 2019” and in September it is “Wydarzenia we wrześniu 2019″ etc.

    Could somebody advice how this can be achieved?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Andras Guseo

    (@aguseo)

    Hi @lge987

    This is a very tricky one, especially in languages like Polish or Slovak or Hungarian etc.

    What you can possibly do is tap into a filter that will let you make some modifications. Something like:

    add_filter( 'tribe_get_events_title', 'my_new_title');
    function my_new_title( $title ) {
        // do something with the $title string, like
        if ( tribe_is_month() ) {
            $title = str_ireplace( 'Styczeń', 'styczniu', $title );
            $title = str_ireplace( 'luty', 'lutym', $title );
            ...
            return $title;
        }
    }

    You will need to add a line for all months.
    Also, this is case-insensitive so you can look up ‘Luty’ or ‘luty’ it will find both. (or LUty)

    The string itself in the .po file is ‘%1$s for %2$s’ and you will see a note next to it that it’s for month view.

    Hope this helps.

    Cheers,
    Andras

    Thread Starter lge987

    (@lge987)

    Hi András,
    thank you very much for the perfect solution. I really appreciate it.

    Best regards,
    Łukasz

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Title above the calendar grid – translation’ is closed to new replies.