• Resolved onnowebmaster

    (@onnowebmaster)


    We have a bilingual (English/French) website and use the My Calendar plugin. On French pages the text string “All Day” is not translated and appears on the calendar in English.

    I found a question on the forum regarding the translation of the text string “Week of” where you responded that the text string had not been properly internationalized and I am wondering if this might be the same situation. (Like “Week of”, “All Day” is a user configurable string but we are using the default value).

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Joe Dolson

    (@joedolson)

    The ‘All Day’ text is a setting, so you would need to change it to your preferred text.

    Thread Starter onnowebmaster

    (@onnowebmaster)

    The problem is that we want “All Day” to appear on the English page and “Toute la journée” on the French page. I have been trying to find a way to do this.

    As background, we use the Polylang plugin. I create two My Calendar instances for each event, one in English (category “English”) and one in French (category “Fran?ais”). The calendars on the English and French pages are then filtered on the appropriate category to display the correct language. All other text on the French page (grid headings, etc.) is correctly shown in French with the exception of the text string “All Day”.

    There is a Languages tab on the Dashboard (which I expect is created by Polylang) with a “Strings translations” function. However, the text string “All Day” does not appear there.

    I’m not at all knowledgeable on this, but I have wondered whether custom CSS code or a custom script on the French page to translate the text string might be a possible approach. However, I don’t want to pursue that if there is some way within My Calendar have text strings be language dependent or have text strings appear on the “Strings translation” tab.

    Plugin Author Joe Dolson

    (@joedolson)

    No problem. I’d recommend using the filter ‘mc_notime_label’ to add custom terms to make it work for you.

    I don’t know exactly what Polylang does to indicate which language you’re currently using, but it would look something like this:

    function my_notime_label( $string, $event ) {
        $language = get_current_language_from_polylang_somehow();
        if ( 'fr' == $language ) {
            return 'French text';
        }
    
        return 'English text';
    }
    add_filter( 'mc_notime_label', 'my_notime_label', 10, 2 );
    Thread Starter onnowebmaster

    (@onnowebmaster)

    Joe,

    Thanks for the very speedy reply to my inquiry. We’ll try your suggestion.

    Thread Starter onnowebmaster

    (@onnowebmaster)

    In my ongoing efforts, I stumbled upon a setting that I didn’t know existed. The “Time label” can be specified on a per-event basis. This control only appears once the “All day event” box on the “Edit event” screen has been checked (which largely explains why I was not aware of it). We have very few all day events and it has been a while since I actually created one. Perhaps this is a relatively new feature or I may have seen it and just not realized its significance at the time. But, in any event, it is exactly what I need.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Text string “All Day” not translated’ is closed to new replies.