Skip Navigation

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

Problem:

Hard-coded strings translation is not working. The strings only show when the option Look for strings while pages are rendered is enabled.

Solution:

In this case, the problem was stuck transients in the wp-options table in the DB.

1. Take a backup of the DB of your site or a full backup of your site.

2. Edit the DB of your site with the interface your server uses, for example, phpMyAdmin.

3. In the wp_options table, search for the option_name = _transient_wpml_st_upgrade_in_progress.

4. Delete this row.

Now the strings should show the translations on the front end.

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 31 replies, has 2 voices.

Last updated by Mark 1 year, 3 months ago.

Assisted by: Itamar.

Author Posts
December 26, 2022 at 10:39 am

Mark

We recently updated the WPML plugin to the latest version, after which we are facing an issue with the string translation.

December 26, 2022 at 12:35 pm
December 26, 2022 at 3:31 pm #12714225

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

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

Hi,

I'll wait for your reply in case, you need more help with this issue.

Regards,
Itamar.

December 27, 2022 at 8:57 am #12716577

Mark

Hi again,
Please go ahead with cloning the site.

December 27, 2022 at 7:10 pm #12719393

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

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

Thanks,

I've made a copy of your site with the Duplicator plugin (now removed). I'll continue to investigate this issue on my local server and will update you here as soon as I have news.

Thank you for your patience.
Itamar.

December 27, 2022 at 9:43 pm #12719819

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

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

Hi,

It seems your site has some custom configurations that I could not spot. With the copy of your site on my local server, I could not work with the Language URL format: Different languages in directories. But when I switched to the Language URL format: Language name added as a parameter, things started to work. And the string from the theme showed the translation. Please see the attached screenshot.

You are using the Boccia theme By Oakwood Creative Digital Agency. This theme is not known to us.

Is it a custom theme created for your site?

Regards,
Itamar.

2022-12-27_23-10-41.jpg
December 28, 2022 at 3:21 am #12720559

Mark

Yes, it is a custom theme.
But please do note that the issue persists even when we switch to other theme such as twentytwenty.

December 28, 2022 at 8:38 am #12721335

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

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

Hi,

I suspect that custom configurations on your site cause this problem. I could not replicate this issue on my test site with a clean WordPress installation and the twenty-twenty theme. So as far as I can tell, there is no bug in WPML. But I may be wrong, and if so, I need your help replicating this issue. Here is a link to a sandbox site with a fresh WordPress installation. With this link, you'll be directly logged in.

hidden link

I've configured WPML on this site. German is the default language, and English is the second language. Strings Translation is enabled. And the Twenty Twenty-One is active.

If you can replicate this problem on the sandbox site please let me know the steps you took and I'll escalate the issue to our second-tier supporters.

Thanks,
Itamar.

December 28, 2022 at 9:44 am #12721655

Mark

In regard to what you have mentioned, we already have tried this ourselves as well. We created a fresh WP installation and tested the string translations ourselves and it worked as it should. Further, to check if it was the theme issue, we even implemented the same boccia theme in the fresh installation and faced no issues with the string installation.
The problem on the site occurred after we performed maintenance on the site. During the maintenance we firstly updated the WordPress version from 6.0.3 to 6.1 and then updated the rest of the plugins including WPML. As we had mentioned in our earlier conversation, we updated the sitepress-multilingual-cms plugin from version 4.5.11 - 4.5.14 and the WPML String Translation plugin version from 3.2.2 - 3.2.3.
We suspect that during the update, all the changes to the database that was required for the WPML update may not have been successfully executed. However, we can't say for sure so, we are reaching out to you guys for help.

December 28, 2022 at 11:26 am #12722217

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

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

Hi, and thanks for the detailed history of this case.

Indeed sometimes, something breaks during an update, and it is not complete and causing problems.

Do you have a backup of your site before the updates you performed?

If so, then please restore the site from this backup and update it again. Then check if everything works correctly.

Regards,
Itamar.

December 29, 2022 at 9:02 am #12727099

Mark

As you suggested, we setup a new staging using the backup of the site we had before the update and tried updating WPML again and the issue still persists.
A couple of things that we noticed(not sure if they help or not), in the backend on navigating to WPML > support, under the WordPress info, the WP REST API is shown as disabled(See: rest-api.png). Futhermore, the string translation does work when the "Auto register strings for translation" under the "String translation" page is enabled(See: auto-register-string.png)

auto-register-string.png
rest-api.png
December 30, 2022 at 10:08 am #12732095

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

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

Hi, and thanks for trying my suggestions.

I need to consult our second-tier supporters regarding this issue. When I have an answer from them, I'll update you here. Please note that I may be able to reply next week.

Thank you for your patience.
Itamar.

January 2, 2023 at 1:49 pm #12740111

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

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

Hi,

I discussed this issue with our second-tier supporter, who confirmed that REST API is needed for Strings Translation to work. Please check our guide on Features in WPML that Depend on the WordPress REST API.

https://wpml.org/documentation/support/rest-api-dependencies/

So we believe Strings Translation should work after fixing the REST API issue on your server.

Regards,
Itamar.

January 3, 2023 at 6:42 am #12742969

Mark

Thanks for your reply. As suggested, we went through the guide and checked whether the REST API endpoints mentioned were working or not. Upon testing we found that both the end points seem to be working and returning information. We tested both the endpoints as logged in and logged out users and in both cases the endpoints are working. Please see attached (Screenshot_wpml-st-v1.png and Screenshot_wpml-tm-v1.png). However, the WordPress information section under the support page still shows the REST API as disabled (See attached: rest-api-status.png). Are there any further steps that we could take to debug this issue? We have tried debugging the issue ourselves and gone through a lot of support forums looking for the solution to the issue we are facing however, we have not been able to find a working solution yet.
We did find a support article with the REST API issue similar to what we are facing: https://wpml.org/errata/rest-api-is-disabled-blocking-some-features-of-wpml-notice-and-performance-issues/. We tried the solution mentioned here replacing the piece of code in the plugin. This showed the REST API as enabled in the support page, but it did not resolve the string translation issue.

Thank You

rest-api-status.png
Screenshot_wpml-tm-v1.png
Screenshot_wpml-st-v1.png
January 3, 2023 at 3:46 pm #12746059

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

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

Hi,

I've shared this information with our second-tier supporter and am waiting for his reply. I'll keep you updated here.

Thank you for your patience.
Itamar.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.