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?
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.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.