This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Andrey 1 year, 5 months ago.

Author Posts
May 5, 2018 at 1:16 pm #1990510

maxP-8

Hello,

I am trying to make my functions.php translatable, but some of it seems to crash the site. Here is an example of the code I want to make translatable:

add_filter( 'woocommerce_checkout_login_message', 'bbloomer_return_customer_message' );
function bbloomer_return_customer_message() {
return 'Have you used ....com before?';
}

I've tried making it like:
return <?php _e('Have you used ....com before?','theme-text-domain') ?> ;

But that results in a 500 error.

Any help? I can't seem to find it on the forum

May 7, 2018 at 6:49 am #2003150

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kiev (GMT+03:00)

While one of my teammates takes care of your ticket, I will provide you with the code to test.

Please try the following :

add_filter( 'woocommerce_checkout_login_message', 'bbloomer_return_customer_message' );
function bbloomer_return_customer_message() {
    return  __('Have you used ....com before?','theme-text-domain');
}

https://wpml.org/faq/language-setup/

The topic ‘[Closed] Translating functions php’ is closed to new replies.