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.

Sun Mon Tue Wed Thu Fri Sat
10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 - -
16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

This topic contains 1 reply, has 0 voices.

Last updated by Itamar 1 month, 2 weeks ago.

Assisted by: Itamar.

Author Posts
April 16, 2025 at 3:03 pm #16939745

daniilA-2

Background of the issue:
I have numerous custom PHP pages that WPML doesn't recognize. These strings don't appear in String Translation at all. From the documentation, I understand the only way is manual registration using: do_action('wpml_register_single_string', $context, $name, $value) to register strings and apply_filters('wpml_translate_single_string', $original_value, $domain, $name) to display translations. However, this isn't practical - I have hundreds of custom template files.

Symptoms:
WPML doesn't recognize strings from custom PHP pages, and they don't appear in String Translation.

Questions:
Is manual registration truly the only solution for recognizing strings in custom PHP pages?

April 16, 2025 at 5:57 pm #16940751

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

We have extensive guides for developers. The main page is here.

https://wpml.org/documentation/support/

Starting with our guides on Achieving WPML Compatibility for Your Themes and Plugins would be good.

https://wpml.org/documentation/support/achieving-wpml-compatibility-for-your-themes-and-plugins/

You need to wrap the strings in your custom templates with the proper GETTEXT functions. You can read more about this here.

hidden link

Then, in WPML -> Theme and plugins localization, you can scan your custom theme or plugin and the strings should appear for translation in WPML -> Strings Translation.

Please let me know if you have any further questions.

Regards,
Itamar.

The topic ‘[Closed] I have numerous custom PHP pages that WPML doesn’t recognize’ is closed to new replies.