Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are working on a site under development and trying to add a string for translation in a child theme custom template using the code:

printf( __( '<a href="%s">Secure your login with Two-Factor Authentication (2FA) and Passkeys</a>', 'buddyboss' ), esc_url( '/account-security/' ) );

However, the string cannot be found for translation.
Solution:
We recommend checking if the 'Auto register untranslated strings' option is enabled, as it should register new strings by default. Additionally, for custom coding scenarios, you might need to scan the theme or plugin files. You can do this through WPML-> Theme and plugins localization.

The 'Auto register untranslated strings' option registers the untranslated strings while visiting the site and adds them to String Translation. The 'Track where strings appear' feature helps identify the source and location of the strings on the site.

If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.

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 1 voice.

Last updated by Osama Mersal 4 days, 10 hours ago.

Assisted by: Osama Mersal.

Author Posts
March 3, 2025 at 8:30 am #16767266

ericH-23

Background of the issue:
I am working on a site under development and trying to add a string for translation in a child theme custom template. The code I added is: printf( __( 'Secure your login with Two-Factor Authentication (2FA) and Passkeys', 'buddyboss' ), esc_url( '/account-security/' ) );

Symptoms:
The string in the child theme custom template cannot be found for translation.

Questions:
Why can't I find the string for translation in WPML?

March 3, 2025 at 9:38 am #16767649

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

Thanks for contacting us.

While you wait for my colleague to take over the ticket, let me try to help you with the issue quickly.

Can you please check our docs and try to use different approach, for example:

<a href="http://wpml.org/" ><?php esc_html_e( 'Translated with WPML', 'my-domain' ); ?></a>

- https://wpml.org/documentation/support/how-to-use-gettext/

Then go to WPML > Theme and plugins localization and scan your child theme, after it is done go to WPML > String translation and translate.

Regards,
Drazen

March 3, 2025 at 7:57 pm #16770702

ericH-23

Hi,

Thanks for your advice – it worked!

Previously, I was able to retrieve the strings using the "Track where strings appear on the site" feature, but this no longer seems to work. Has this functionality changed?

Right now, I can only get the strings by scanning the child theme, which works but seems to be the only solution.

Would appreciate any insights on this.

Thanks and best regards,
Eric

March 4, 2025 at 4:12 am #16771351

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Eric,

I'm Osama from WPML forums support. I'll be glad to help you today.

The "Auto register untranslated strings" option is now enabled by default and should register new strings. However, in some custom coding cases, you will need to scan the theme/plugin files via WPML-> Theme and plugins localization.

Best regards,
Osama

2025-03-04_06-06-07.png
March 4, 2025 at 5:02 pm #16775320

ericH-23

Hi,
Thanks, but what is the difference between the two options of your screenshot?
Kind regards
Eric

March 5, 2025 at 6:32 am #16776635

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Eric,

The "Auto register untranslated strings" option registers the untranslated strings while visiting the site and adds them to String Translation.

The "Track where strings appear" tells you where the strings come from and where they appear on the site.

Best regards,
Osama

2025-03-05_08-30-06.png