Support

Home Forums Event Espresso Premium Translation of Event Category Widget

Translation of Event Category Widget

Posted: August 25, 2015 at 11:36 am

Viewing 3 reply threads


Frederik Delfosse

August 25, 2015 at 11:36 am

Hello,

I have been busy translating event espresso to Dutch but I can’t seem to find how to edit the /?s=&event-category[]=11 widget.

There is no sign of the field used to translate this in the .PO file.

You can see what I mean overhere : http://publicevents.be/?s=&event-category%5B%5D=11

Is this hardcoded, and where could I change it ?


Lorenzo Orlando Caum

  • Support Staff

August 25, 2015 at 12:49 pm

Hi there Frederik, we are working on some improvements for translations today so your support post caught my eye.

I can see the categories widget in the sidebar and I think that is from your theme.

Are you wanting to change the heading from Categories to something else? A gettext filter may be able to help here.


Lorenzo


Frederik Delfosse

August 25, 2015 at 12:52 pm

Hey Lorenzo,

Thank you for noticing and as a matter of fact I believe that you are right. I have bought this theme because you guys recommended in a post, but clearly this is not EE4 related. Sorry about that!

My knowledge doesn’t go that far to translate such things through gettext 🙂

Greetings,
Frederik


Lorenzo Orlando Caum

  • Support Staff

August 25, 2015 at 2:56 pm

Hello again Frederik,

Could you give this gettext filter a try?

//* Change the messaging for event categories widget heading
function ee_translation_changes_for_messaging( $translated, $original, $domain ) {
    $strings = array(
        'CATEGORIES' => 'Replace Me',
    );
    if ( isset( $strings[$original] ) ) {
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
}
add_filter( 'gettext', 'ee_translation_changes_for_messaging', 10, 3 );

It can be added to your theme’s functions.php file or via a site specific plugin. Then change the words Replace Me to the actual translation that you would like to use.

Let us know if this helps.


Lorenzo

Viewing 3 reply threads

The support post ‘Translation of Event Category Widget’ 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.

Event Espresso