Please make sure to update to WPML 4.3.4 before reporting any issue

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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 Radu 4 months, 3 weeks ago.

Assigned support staff: Radu.

Author Posts
June 27, 2019 at 11:34 am #4099595

jerzyr-2

Hello,
I want to translate this text in my code:

// Compatibility
FLThemeCompat::init();

add_action( 'woocommerce_review_order_before_submit', 'add_privacy_checkbox', 9 );
function add_privacy_checkbox() {
woocommerce_form_field( 'privacy_policy', array(
'type' => 'checkbox',
'class' => array('form-row privacy'),
'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,
'label' => 'He leído y acepto la <a href="hidden link">política de privacidad</a>' , 'textdomain',
));
}
add_action( 'woocommerce_checkout_process', 'privacy_checkbox_error_message' );
function privacy_checkbox_error_message() {
if ( ! (int) isset( $_POST['privacy_policy'] ) ) {
wc_add_notice( __( 'Debes aceptar la política de privacidad para realizar el pedido' ), 'error' );
}
}

The text is: He leído y acepto la <a href="hidden link">política de privacidad</a>

June 27, 2019 at 12:50 pm #4100057

Radu
Supporter

Languages: English (English )

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

Hey,

Thank you for reaching out the WPML support!

I think that you just forgot to use a GetText call for the text. So just simply replace this line:

'label' => 'He leído y acepto la <a href="<em><u>hidden link</u></em>">política de privacidad</a>' , 'textdomain',

with this one:

'label' => __('He leído y acepto la <a href="<em><u>hidden link</u></em>">política de privacidad</a>' , 'textdomain'),

and tell me how this works now.

Thanks,
Radu

The topic ‘[Closed] translate code’ is closed to new replies.