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.

No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by paoloC-16 1 year ago.

Assigned support staff: Bigul.

Author Posts
October 15, 2019 at 6:34 pm #4759971

paoloC-16

Tell us what you are trying to do? i wuold like to translate strings added with "code snippets wp plugin" but i can't find them. I read this other post: https://wpml.org/forums/topic/i-cant-see-translation-for-code-snippet-plugin/ but my string are correctly inserted using "__(" so i should find them.

excerpt of my code:
...
$message = sprintf( __( 'Modified the authorization to the payment form for the user:' ) ) . "\r\n\r\n";
$message .= sprintf( __( 'Username: %s' ), $user->display_name ). "\r\n\r\n";
$message .= sprintf( __( 'Form Payment Authorization: %s' ), $user->abil_pag ) . "\r\n\r\n";
$message .= sprintf( __( '(Old Value) %s' ), $old_user_data ). "\r\n\r\n";
wp_mail( array($admin_email, $user->user_email), sprintf( __( 'User profile update: Enabling the payment form.' ), get_option('blogname') ), $message );
...

Code Snippets WP Plugin
hidden link

October 16, 2019 at 8:54 am #4763721

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

The code you are using is not compatible with the standard of WordPress localization. Please check with this documentation for more details https://codex.wordpress.org/I18n_for_WordPress_Developers#Placeholders

So please edit the code like the following and check you are getting the expected result or not.

$message = sprintf( __( 'Modified the authorization to the payment form for the user:','my-text-domain' ) ) . "\r\n\r\n";

It will help you to register the string for translation under *my-text-domain* strings domain.

--
Thanks!

Bigul

October 17, 2019 at 11:27 am #4772945

paoloC-16

My issue is resolved now. Thank you!