Support

Home Forums Event Espresso Premium EE4 Translation not Working

EE4 Translation not Working

Posted: September 22, 2014 at 2:44 am


Philipp Meier

September 22, 2014 at 2:44 am

Hello

I’ve changed my wordpress installation to German (as described here: https://eventespresso.com/wiki/how-to-change-languages/ ). WordPress and part of EE4 is now German.

I also (manually) created the directory ../wp-content/uploads/espresso/languages and downloaded the German mo/po files from Github

event_espresso-de_DE.mo and event_espresso-de_DE.po and uploaded it to the directory.

I tried to refresh, empty cache etc, but the translation won’t appear. (i double checked with Poedit that the phrases are translated, which they are).

regards
Phil


Josh

  • Support Staff

September 22, 2014 at 8:56 am

Hi Philipp,

Can you let me know which version of WordPress you are using?


Philipp Meier

September 22, 2014 at 9:02 am

Hello

I’ve just upgraded to WP 4.0


Josh

  • Support Staff

September 22, 2014 at 9:59 am

Is the German option activated in WP > Settings > General (last option on the page)?


Philipp Meier

September 22, 2014 at 3:07 pm

Hi

Yes I did. WP is now German and part of EE4 as well. I just installed the event_espresso-de_DE.mo and event_espresso-de_DE.po to have additional translation.

regards
Phil


Lorenzo Orlando Caum

  • Support Staff

September 22, 2014 at 3:14 pm

Hi Phil,

Could you get the latest files from GlotPress:

https://eventespresso.com/glotpress/


Lorenzo


Philipp Meier

September 22, 2014 at 3:24 pm

Hi

I just downloaded the PO and MO file (again). Uploaded it to ../wp-content/uploads/espresso/languages …

did a refresh. nothing changed.

I’m looking for line 5747 or 15343 in the .po file where it says Verfügbare Plätze / Available Tickets

they should appear on this site, right? http://awesomescreenshot.com/0183j5enee
regards
Phil


Lorenzo Orlando Caum

  • Support Staff

September 22, 2014 at 3:27 pm

What are you trying to change “Available Tickets” to?


Lorenzo


Philipp Meier

September 22, 2014 at 3:29 pm

If I read correctly, ghe German PO file should translate it to “Verfügbare Plätze” as defined on line 5747 or 15343 in the .po file…. not?

Phil


Lorenzo Orlando Caum

  • Support Staff

September 22, 2014 at 3:36 pm

It should as it is used by the ticket template file:

http://cl.ly/image/0L1f1h3P3I3p

I’ll run some testing and update this support post.


Lorenzo


Philipp Meier

September 22, 2014 at 3:40 pm

Thanks! In the meantime I’m translating/approving your German translation file.

regards
Phil


Lorenzo Orlando Caum

  • Support Staff

September 22, 2014 at 3:49 pm

Hi,

Could you give this a try:

function mycustom_filter_gettext_available_tickets( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Available Tickets' => 'Verfügbare Plätze',
        'Available Tickets:' => 'Verfügbare Plätze:',
        // 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_filter_gettext_available_tickets', 10, 3 );


Lorenzo


Philipp Meier

September 22, 2014 at 11:56 pm

Hey Lorenzo

What should I do with this? 😉

regards
Phil


Dean

September 23, 2014 at 1:14 am

Hi,

You can either add it to your themes functions.php or better yet use a custom functions plugin, we have instructions on how to create one here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


Philipp Meier

September 24, 2014 at 3:40 am

Hello

I’created this and yes, Verfügbare Plätze are now correct. The thing is, that I would like to use the PO/MO file to make the translation and not change every word/sentence for it selfe. I also registered as an translator at your site to modify MO/PO’s. that way everybody could benefit from my work ….

regards
Phil


Tony

  • Support Staff

September 25, 2014 at 4:50 am

Hi Philipp,

Can you provide me with a copy of the .PO and .MO files that are not working please? The ones located within wp-content/uploads/espresso/languages/

I’d like to take a look at the files and see if there is any reason for them not to load.

If you could email them to support[at]eventespresso.com I’ll take a look.


Tony

  • Support Staff

October 2, 2014 at 2:17 am

Hi Philipp,

The files that you have sent, are those the exact files you are currently trying to use?

The reason I ask is the filenames are currently incorrect. EE4 looks for ‘event_espresso-*locale*.mo’

So in this case the files should be renamed to event_espresso-de_DE.mo/po

Then placed within wp-content/uploads/espresso/languages/

Your translations should then work correctly.


Philipp Meier

October 6, 2014 at 7:26 am

OK it works ! yeahh !!!!!


Tony

  • Support Staff

October 6, 2014 at 7:31 am

Thank you for letting us know 🙂


Lorenzo Orlando Caum

  • Support Staff

September 12, 2015 at 2:52 pm

Hello again Philipp,

We have a new resource that explains how to translate Event Espresso. You can view it here:

https://eventespresso.com/wiki/how-to-translate-event-espresso/

Also, GlotPress now has translation strings that are up to date for the current Event Espresso 4.8.x platform.


Lorenzo

The support post ‘EE4 Translation not Working’ 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