I just have to adjust one sentence in the checkout page.
Unfortunately I couldn’t find anything in the checkout PHP files and in the forum.
Unfortunately I don’t know what the sentence is in English.
In German it reads:
“Anmerkung: Änderungen in Ihren persönlichen Informationen werden mit Ihrem Benutzerprofil synchronisiert.”
Screenshot:
This sentence should be changed to the following:
“Anmerkung: Änderungen in Deinen persönlichen Informationen werden mit Deinem Benutzerprofil synchronisiert.”
For the previous translations into the German language I added a function in the function.php.
The function works as follows:
function mycustom_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
'In order to process your registration, we ask you to provide the following information.%1$sPlease note that all fields marked with an asterisk (%2$s) are required.' => 'Um Deine Anmeldung zu bearbeiten, bitten wir Dich, folgende Angaben zu machen.%1$sBitte beachte, dass alle mit einem Stern (%2$s) gekennzeichneten Felder Pflichtfelder sind.',
'%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation.' => '%1$sVielen Dank%2$sDeine Ticketbuchung wurde erfolgreich durchgeführt%3$sWir haben dir eine E-Mail geschickt, in der alle Details stehen.',
'This option allows you to use the above information for all additional attendee question fields. %sPlease note:%s some events may have additional questions that you may still be required to answer in order to complete your registration.' => 'Mit dieser Option kannst Du die oben angegeben Informationen für alle weiteren Teilnehmerinformationen verwenden. %sAnmerkung:%s Einige Veranstaltungen können zusätzliche Informationen benötigen, die Du eingeben musst, um die Registrierung abzuschließen.',
'Registration Details' => 'Ticketdetails',
"We're sorry, but all tickets sales have ended because the event is expired." => 'Alle Tickets sind ausgebucht.',
'Access' => 'Zugang',
'Total%sSold' => 'Bereits gebucht',
'Total Spaces%sLeft' => 'Verfügbare Tickets',
'REG Code' => 'Buchungscode',
'REG Status' => 'Buchungsstatus',
// 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', 10, 3 );
Could you tell me what the sentence is in English so that I can translate it correctly into German?
If I want to translate the sentence as it appears on the website, it doesn’t work.
The code for this is as follows:
function mycustom_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
"After clicking 'Finalize Registration', you will be forwarded to PayPal website to Login and make your payment." => 'Nachdem Du auf den Button ‚Ticket(s) jetzt buchen‘ geklickt hast wirst du zur PayPal Seite weitergeleitet. Dort musst Du Dich dann mit Deinem PayPal Account einloggen und die Zahlung durchführen.',
// 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', 10, 3 );
I tested the code in different versions: 'After clicking \'Finalize Registration\', you will be forwarded to PayPal website to Login and make your payment.' => 'Nachdem Du auf den Button ‚Ticket(s) jetzt buchen‘ geklickt hast wirst du zur PayPal Seite weitergeleitet. Dort musst Du Dich dann mit Deinem PayPal Account einloggen und die Zahlung durchführen.', "After clicking 'Finalize Registration', you will be forwarded to PayPal website to Login and make your payment." => "Nachdem Du auf den Button ‚Ticket(s) jetzt buchen‘ geklickt hast wirst du zur PayPal Seite weitergeleitet. Dort musst Du Dich dann mit Deinem PayPal Account einloggen und die Zahlung durchführen.",
For testing purposes only, I also tested the sentence from your translation page with the different variants. 'After clicking 'Finalize Registration', you will be forwarded to PayPal to make your payment. Make sure you return to this site in order to properly finalize your registration.' => 'Nachdem Du auf den Button ‚Ticket(s) jetzt buchen‘ geklickt hast wirst du zur PayPal Seite weitergeleitet. Dort musst Du Dich dann mit Deinem PayPal Account einloggen und die Zahlung durchführen.',
I’m not finding my code error right now, can you help me?
After I wrote the message, I found the solution…
The text does not have to be translated in the function.php, but the display is included in the PayPal Express settings (Event Espresso -> Payment Methods -> PayPal Express -> Description).
The text does not have to be translated in the function.php, but the display is included in the PayPal Express settings
Correct.
To explain further, some strings are saved to the database and only translated on activation. So if you have the translation in place when EE was installed the above would have been translated.
After that, it is available in the admin so we can’t translate it afterwards.
This is true for pretty much all of the fields for payment methods and message templates.
The support post ‘Translation of a sentence in checkout page’ 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 Event Espresso 3 and Event Espresso 4.