Support

Home Forums Events Calendar Add-on EE4 Calendar Tooltip Translation 'Event Times: '

EE4 Calendar Tooltip Translation 'Event Times: '

Posted: February 28, 2018 at 5:41 am


rosenberg.ayurveda

February 28, 2018 at 5:41 am

Hi Support Team,
i already tried the snippet from here: https://eventespresso.com/topic/remove-part-of-the-tooltip-window/
It seems not working in EE4. I can not find the “Event Times:” slug in MO/PO-FIles in the Plugins Event Espresso or Calendar for Translation.
Can u help me please?


Tony

  • Support Staff

February 28, 2018 at 5:49 am

Hi there,

Just to confirm, the snippet you need is this one:

https://eventespresso.com/topic/remove-part-of-the-tooltip-window/#post-91101

Is that the version you are using?


rosenberg.ayurveda

February 28, 2018 at 6:02 am

Yes, this is the one i use. It’s placed in an custom plugin:

/**
*  Translate Event Times in Calendar Tooltip
*/
function mycustom_ee_filter_et_gettext( $translated, $original, $domain ) {

    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Event Time: ' => 'Uhrzeit: ',
        'Event Times: ' => 'Uhrzeit: '
        // Add some more strings here
    );

    // See if the current string is in the $strings array
    // If so, replace its translation
    if ( isset( $strings[$original] ) ) {
        // This accomplishes the same thing as __()
        // but without running it through the filter again
        $translations = &get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }

    return $translated;
}

add_filter( 'gettext', 'mycustom_ee_filter_et_gettext', 10, 3 );


rosenberg.ayurveda

February 28, 2018 at 6:12 am

If i set the Tooltip show setting to “yes” it is working ๐Ÿ™‚ But not if i set it to ‘no’ . The stardard-Browser Tooltip that appears then on hover showing “Date Times: ” not the translation.


Tony

  • Support Staff

February 28, 2018 at 6:16 am

Has that custom plugin been activated on the site?

The reason I ask if I’ve just copied your code above and it is translating the text as expected – http://take.ms/n44ZP


rosenberg.ayurveda

February 28, 2018 at 6:20 am

you are right. It is activated ๐Ÿ™‚ Setting the display Tooltip to ‘No’ in EE->calender, then the default Tooltip shows the original slug.


Tony

  • Support Staff

February 28, 2018 at 6:23 am

Ahh yeah, ok, that’s a different string and looks like one we’ve missed for translation.

I’ll create a ticket for our developers to fix but in the mean time you would need to set the Tooltips to Yes to use the translated string.


rosenberg.ayurveda

February 28, 2018 at 6:28 am

ok, thanks Tony ๐Ÿ™‚ have a nice day!

The support post ‘EE4 Calendar Tooltip Translation 'Event Times: '’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for the Events Calendarย add-on.
Documentation for Events Calendar add-on and EE4 Events Calendar add-on
http://eventespresso.com/wiki/events-calendar-add-on/

Status: closed

Updated by  rosenberg.ayurveda 3 months, 3 weeks ago ago

Topic Tags

Notifications

This topic is: resolved
Do NOT follow this link or you will be banned from the site!