Skip Navigation

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 5 replies, has 3 voices.

Last updated by Mateus Getulio 1 month, 1 week ago.

Assigned support staff: Mateus Getulio.

Author Posts
April 23, 2021 at 9:24 am #8607573

florianS-67

Tell us what you are trying to do?
Translating the following texts:

1) "Yes, i have provided the information in Roman spelling for international shipping." from function php:

add_action( 'woocommerce_review_order_before_submit', 'bt_add_checkout_checkbox', 10 );
/**
* Add WooCommerce Checkbox checkout
*/
function bt_add_checkout_checkbox() {

woocommerce_form_field( 'checkout-checkbox', array( // CSS ID
'type' => 'checkbox',
'class' => array('form-row mycheckbox'), // CSS Class
'label_class' => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'),
'input_class' => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox'),
'required' => true, // Mandatory or Optional
'label' => 'Yes, i have provided the information in Roman spelling for international shipping.', 'textdomain' // Label and Link
));
}

add_action( 'woocommerce_checkout_process', 'bt_add_checkout_checkbox_warning' );
/**
* Alert if checkbox not checked
*/
function bt_add_checkout_checkbox_warning() {
if ( ! (int) isset( $_POST['checkout-checkbox'] ) ) {
wc_add_notice( __( 'Please confirm that you have provided your information in roman spelling.' ), 'error' );
}
}

2) ALSO:
I cant seem to find the following text to translate form checkout:

"Your personal data will be used to process your order, support your experience throughout this website, and for other purposes described in our privacy policy.

I have read and agree to the website terms and conditions *"

Where can i find this?

Kind regards
Florian

April 24, 2021 at 9:02 am #8613823

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+02:00)

Hi Florian,

thanks for contacting us.

Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

You need to add GetText calls to be able to translate the label, like you did with

wc_add_notice( __( 'Please confirm that you have provided your information in roman spelling.' ), 'error' );

Please see here https://wpml.org/documentation/support/enabling-text-translation-for-themes-not-compatible-with-wpml/

April 29, 2021 at 8:05 pm #8657503

florianS-67

I don't really know how the code must be notified. It's valid and working. Please forward me to a colleague to get assistance. Thank you!!

April 30, 2021 at 3:30 pm #8664005

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Thanks for contacting us. I'll be glad to help you with this.

Please try to wrap the 'label' string in a GetText function, like this:

'label' => __('Yes, i have provided the information in Roman spelling for international shipping.', 'textdomain') // Label and Link

Regarding the string from the form checkout, could you please give me more details about how it is added to your site? By a plugin or another custom code? Being the second option, please share with us the code.

If the text form is coming from a plugin, test these steps:

- Please go to WPML -> Theme and plugins localization
- Select all plugins in the list and click on "Scan selected plugins for strings"
- When that finishes, select your theme in the other list and click on "Scan selected themes for strings"
- Now go to WPML -> String Translation and search for one of the items you couldn't find to translate and see if it will display now

If that doesn't work, please try to enable the option "Look for strings while pages are rendered" in WPML -> String Translation. Then visit that page in which the checkout form is located and go back to the String Translation, refresh the page and check if you'll be able to locate the strings now. (Please don't forget to uncheck the option "Look for strings while pages are rendered" once you're done).

Give those steps a try, and let us know how it goes. I'm looking forward to your reply.

Best regards,
Mateus.

April 30, 2021 at 6:23 pm #8664735

florianS-67

Hi Mateus,

i modified the code like you told me, however i still cant find it in the string translations?

I managed to translate the second phrase mentioned in my previous request by now.

Thanks. Kind regards
Florian

April 30, 2021 at 8:55 pm #8665285

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Thanks for your reply.

Could you please try to register the message string following the previous steps? I.e., scan your theme and plugins, and in case it doesn't work, visit the page where it appears with the option "Look for strings while pages are rendered" enabled. It should work now with the modified code.

Another attempt is to search for those strings in the "Translate texts in admin screens" section of String Translation. To do that, please follow these instructions:

- Go to WPML -> String Translation and click on "Translate texts in admin screens" at the bottom of the page
- Search for one of the items you can't translate
- Select that string and include it in the String Translation
- Go to WPML -> String Translation and search now for that item and see if it will display now for translation

If you still can't find and translate the string, please tell us in which file its code is located. Also, I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link

Please, let me know if you need any additional details. Have a nice day.