Support

Home Forums Event Espresso Premium Personalised Language EE4

Personalised Language EE4

Posted: February 2, 2015 at 4:00 am

Viewing 11 reply threads


Lucey

February 2, 2015 at 4:00 am

I’m using the language as en_GP.
I have uploaded a personalised language file to the folder:
/wp-content/uploads/espresso/languages

Files Names:
event_espresso-en_GB.mo
event_espresso-en_GB.po

But the words are not changing. I have renamed the word “Payment”, but still the word “Payment” there.

I installed at wp-config.php the language as well:
define (‘WPLANG’, ‘en_GB’);

I also have tried update the language file inside the plugin folder, (I know it’s not right) but doesn’t work.

Thank you


Tony

  • Support Staff

February 2, 2015 at 4:17 am

Hi Lucey,

If you go to Dashboard -> Settings -> General.

At the bottom of that page you should a ‘Site Language’, if so what is currently selected there?


Lucey

February 2, 2015 at 4:20 am

Hello Tony,
It’s: English (UK)


Tony

  • Support Staff

February 2, 2015 at 4:39 am

Can you send me you MO/PO file so I can test those please?

Translating EE4 is working as expected on my tests sites, so need to try and find the cause.

If so please send the files to support[at]eventespresso.com, be sure to include a link to this thread so we can link the two.


Lucey

February 2, 2015 at 4:51 am

Files sent.

Thank you


Tony

  • Support Staff

February 2, 2015 at 10:36 am

Hi Lucey,

When translating strings each string is actually unique.

So for example translating the string ‘Payment’ would not also translate ‘Make a Payment’.

Each of those strings need to be translated individually.

Can you provide details of where the strings are you would like to translate?


Lucey

February 3, 2015 at 3:02 am

I want to translate this fields:

Page Confirm Registration
Item number 2:

Today text: Payment Options
Should be: Confirm Registration

Title
Today text: Ticket Details
Should be: Rehearsals Details

Final Button:
Today text: Proceed to payment options
Should be: Proceed to confirmation page


Lorenzo Orlando Caum

  • Support Staff

February 3, 2015 at 9:48 am

Hey there Lucey,

Try this sample coding:

//* Replace certain messaging in Event Espresso 4
function ee_change_certain_messaging( $translated, $original, $domain ) {
 
    $strings = array(
        '%s Payment Options' => '%s Confirm Registration',
        'Ticket Details' => 'Rehearsal Details',
    );

    if ( isset( $strings[$original] ) ) {
        $translations = &get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'ee_change_certain_messaging', 10, 3 );

//* Replace proceed to payment options messaging in Event Espresso 4
function ee_proceed_to_button() {
 return 'Proceed to';
}

add_filter ('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', 'ee_proceed_to_button');

function ee_payment_options_button( $translated, $original, $domain ) {
$strings = array(
 'Payment%sOptions' => ' Confirmation Page'
 );
if ( isset( $strings[$original] ) ) {
 $translations = &get_translations_for_domain( $domain );
 $translated = $translations->translate( $strings[$original] );
 }
return $translated;
}

add_filter( 'gettext', 'ee_payment_options_button', 10, 3 );

It can be added to your child theme’s functions.php file (do not include the opening php tag) or a site specific plugin:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


Lorenzo


Lucey

February 3, 2015 at 10:02 am

Worked Lorenzo,

Thank you!


Lucey

February 3, 2015 at 10:04 am

But about the file translation? Do you guys know why didn’t work?
I’m asking because if in the future I need translate more options.

Thank you


Lorenzo Orlando Caum

  • Support Staff

February 3, 2015 at 11:08 am

Hi, each string is unique.

For example, if you changed the word Ticket in one string, then it would only affect that string alone. I mention this as the word ticket is used many times on the event pages.

If you look at the gettext filters, you’ll see some examples of those strings.


Lorenzo


Lucey

February 5, 2015 at 2:46 am

I checked very well the entire list with my words translated, but nothing have changed.
For now the conde you sent Lorenzo, fixed in another way my question, so I’ll close the topic.

Thank you

Viewing 11 reply threads

The support post ‘Personalised Language EE4’ 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