Support

Home Forums Event Espresso Premium Replacing text "Attendee" is not working

Replacing text "Attendee" is not working

Posted: February 10, 2015 at 2:39 pm

Viewing 8 reply threads


mhackman

February 10, 2015 at 2:39 pm

I am using EE4.6.4 and trying to replace text “Attendee” but it not replace, I have applied all of the below link methods.
https://eventespresso.com/wiki/how-to-change-wording-with-poedit/
Please help me in this regard


Tony

  • Support Staff

February 11, 2015 at 6:42 am

Hi mhackman,

Which instance of ‘Attendee’ are trying to change?

To note simple traslating ‘Attendee’ to ‘Registrant’ (for example) does not translate that string within a string…

So doing the above would only change ‘Attendee’ is that is all that was in that string, a string such as ‘Attendee Information’ is another string and must be translated as separately.


mhackman

February 11, 2015 at 12:30 pm

I have replace all the strings which contains ‘Attendee’ using .po file using Poedit, and uploaded .mo file to upload/espresso/languages
and also tried to replace ‘Attendee Information’ using this code snippet
function youruniqueprefix_filter_gettext( $translation, $single, $plural, $number, $domain ) {

$strings = array(
‘Attendee Information’ => ‘Participant Information’,
‘%d Attendee’ => ‘%d Participants’
// Add some more strings here
);

if ( isset( $strings[$translation] ) ) {
$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$translation] );
}

return $translated;
}

add_filter( ‘ngettext’, ‘youruniqueprefix_filter_gettext’, 10, 5 );

but anything did not worked


Lorenzo Orlando Caum

  • Support Staff

February 11, 2015 at 12:55 pm

Hi, I think you are wanting to replace the word “Attendee” with a new word.

That isn’t how the gettext filter works. It needs an exact match.

For example, your gettext filter would translate this phrase:

%d Attendee

…but it would not translate this one:

My Attendee will be arriving early for my event.

Can you post a screenshot of the are that you are wanting to change? We’ll then share the exact match that is needed.

https://eventespresso.com/wiki/troubleshooting-checklist/#screenshots

A link to the page with the text would also work.

Thanks


Lorenzo


mhackman

February 11, 2015 at 2:07 pm

I am trying to replace this test
https://www.dropbox.com/s/30j6bnvibo7colq/loadtime.jpg?dl=0

using this code snippet
function youruniqueprefix_filter_gettext( $translation, $single, $plural, $number, $domain ) {

$strings = array(
‘Attendee Information’ => ‘Participant Information’,
‘Attendee’ => ‘Participants’
// Add some more strings here
);

if ( isset( $strings[$translation] ) ) {
$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$translation] );
}

return $translated;
}

add_filter( ‘ngettext’, ‘youruniqueprefix_filter_gettext’, 10, 5 );

Help me in this regard


Tony

  • Support Staff

February 12, 2015 at 4:14 am

The string you need to translate is ‘Attendee %d’.

So change this line:

‘Attendee’ => ‘Participants’

To this

‘Attendee %d’ => ‘Participant %d’

The %d is the place holder for the actual number.


mhackman

February 12, 2015 at 8:07 am

Still it is not replacing the text


Tony

  • Support Staff

February 12, 2015 at 11:53 am

The snippet of code you are using is not the one provided on this page:

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/

The snipped above is throwing errors.

Try using this:

https://gist.github.com/Pebblo/4c819243acfee1ce36b1

Which is the snippet from our tutorial page, with the correct strings input.

You can add this to your themes functions.php file or a site specific plugin


mhackman

February 12, 2015 at 1:19 pm

Thanks a lot. issue has been resolved

Viewing 8 reply threads

The support post ‘Replacing text "Attendee" is 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