Home›Support›English Support›[Resolved] I can't understand how do i translate custom theme elements using WPML
[Resolved] I can't understand how do i translate custom theme elements using WPML
This thread is resolved. Here is a description of the problem and solution.
Problem: You are unable to translate custom elements in your theme that are not part of the standard text content using WPML. Solution: 1. Navigate to WPML >> String Translation and enable the 'Look for strings while pages are rendered' option in the Auto register strings for translation section. 2. Visit the page on the front end where the string appears. 3. Return to the WPML >> String Translation page and search for those strings individually. 4. Translate the string. 5. After translating, uncheck the auto-registration option. If these steps do not resolve the issue, increase the WP Memory Limit in your wp-config.php file by adding:
For strings added via Elementor or theme options, follow the steps in the WPML documentation for translating texts in admin screens and using the String Translation page. For more details, visit: Translating Elementor templates and Translating texts in theme.
If the solution provided here does not apply because it is outdated or not relevant to your case, we recommend opening a new support ticket. We also 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. For further assistance, please visit our support forum at WPML Support Forum.
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.
Background of the issue:
I'm working on a website translation, using WPML CMS and string translation components. The site I need help with is hidden link. I've already installed string translator too.
Symptoms:
I can't find a way to translate custom elements which are not a part of a standard text content of the website. The attached image shows examples of these custom elements. Here is the link to the image with examples of such elements: hidden link
Questions:
How do I translate custom theme elements using WPML?
Thank you for contacting WPML Support. If these strings are coming from theme/plugin files or theme/plugins options page then you should be able to translate it from WPML >> String Translation page by following the below steps:
1. Go to the WPML >> String Translation page and in the Auto register strings for translation section, enable the ‘Look for strings while pages are rendered’ option.
2. Re-visit the page on the front end where the string appears.
3. Re-visit the WPML >> String Translation page and search for those strings one by one.
4. Translated the string.
5. After translating the string, unchecked the auto-registration option.
Additionally, please disable the Maintenance mode for a moment so that I can examine the source code and try to see how these strings are added in the default language.
Hi Noman, and thanks for your reply. I've disabled the maintenance mode so you could have a look. I've also included debug info and trying to follow your steps.
1. Go to the WPML >> String Translation page and in the Auto register strings for translation section, enable the ‘Look for strings while pages are rendered’ option.
2. Re-visit the page on the front end where the string appears.
...and did not find a single string on the entire website (as per the settings, they're suppose to be highlighted with yellow)
Thanks for following the above steps. Could you please follow the below steps and let me know how it goes:
1. The current WP Memory Limit on your site is 40MB. The WP memory limit needs to be increased, it's different from PHP memory. PHP memory is fine but WordPress uses 40MB as default in your site. The minimum requirements for WPML are 128MB: https://wpml.org/home/minimum-requirements/
Please add this line to your wp-config.php file to increase WP memory, wp-config.php file is located in the root of your WP install:
You can add it anywhere in your file. I recommend placing it right before the following line:
/* That's all, stop editing! Happy blogging. */
2. I’ve noticed that the form and Popular Searches strings section are added using Elementor page builder so you should be able to translate that section either using the default WP Editor or WPML Translation Editor.
3. If you have added the “Post a job” string from theme options/customizer then you should be able to translate it by following the below steps:
- Go to WPML >> String Translation page.
- Scroll down and click on the Translate texts in admin screens » link at the bottom of the page.
- Search for the required string.
- Select the string.
- Click on the Add to String Translation button.
- Then click on the "« Return to String Translation" link.
- Add the translation from WPML >> String Translation page.
1) I translate some strings and the translation is updated, but not reflected on the front end (screencast link below)
2) The plugin does not see some strings (screencast link below)
hidden link
Please mark this ticket as private so i could share the admin link. Thanks.
Please help me fix the issue.
thanks.
New threads created by Noman and linked to this one are listed below:
If the original issue is solved please mark this ticket as resolved.
Thank you for your cooperation and patience
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.