Support

Home Forums Event Espresso Premium Attendee Translation with loco translate

Attendee Translation with loco translate

Posted: February 1, 2019 at 12:36 am


dafaguru1

February 1, 2019 at 12:36 am

Hi guys,

got a problem with the translation…

“Attendee” is translate with loco translate but it does’nt work/shown…you can have a look:

https://abg-wuppertal.de/test-event-espresso/

what can i do to fix it?

Thanks ๐Ÿ™‚


Josh

  • Support Staff

February 1, 2019 at 7:02 am

Hi,

Here’s the string in the source:

https://github.com/eventespresso/event-espresso-core/blob/master/modules/single_page_checkout/reg_steps/attendee_information/EE_SPCO_Reg_Step_Attendee_Information.class.php#L298

You’ll note that the translation function used there is esc_html_x(), which unlike many of the other translation-ready strings in EE4. You could check to see if loco translate requires doing something different for translating when the translation function is esc_html_x().


dafaguru1

February 1, 2019 at 1:49 pm

Hi Josh,

thanks, i got it…i’ve overwritten the php-data which you have shown me… ๐Ÿ™‚


Tony

  • Support Staff

February 1, 2019 at 2:02 pm

You’ve edited the PHP files directly? If so that’s not the correct method to translate the plugin and you’ll lose any changes when Event Espresso updates.

You can just translate the Attendee %d string to change the above.


TownCountry

February 2, 2019 at 7:19 am

I have the same problem. I am sure that the Attendee %d string ist translated. What can I do?


Josh

  • Support Staff

February 4, 2019 at 2:35 pm

Hi,

One way to translate the above string would be to use the gettext_with_context filter. Here’s a code example that shows how to use that filter to translate that string:

https://gist.github.com/joshfeck/62183600028f7ff7bd135bfdc89c5684
You can add the above to a functions plugin or, if available, into your WordPress child theme’s functions.php file.


TownCountry

February 5, 2019 at 12:11 am

This reply has been marked as private.


Josh

  • Support Staff

February 5, 2019 at 5:41 am

But it would be nice, if the problem would be fixed in general.

Please explain what exactly “the problem” is. The text is translation-ready. For example, if another plugin is unable to translate that string, the fix will need to happen in the other plugin.


TownCountry

February 5, 2019 at 9:15 am

The problem is, that I can’t translate the text via the PO and MO file.


Josh

  • Support Staff

February 5, 2019 at 9:18 am

May I ask which po file are you using, and where was it downloaded from?


TownCountry

February 5, 2019 at 9:47 am

I downloaded it from https://translate.eventespresso.com/projects/event-espresso-4/de/event-espresso-de_de/


Josh

  • Support Staff

February 8, 2019 at 10:35 am

It doesn’t appear that the string is translated:

https://slack-files.com/T02SY781D-FG22GHKSP-9f70a143f5

I can add one now so if you do another export the .mo file will include a translation for that string.


Josh

  • Support Staff

February 8, 2019 at 10:37 am

OK it’s updated now.

The support post ‘Attendee Translation with loco translate’ 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