Skip to content Skip to sidebar

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

Problem:
The client made changes to various PHP files in their theme, but after rescanning the files in WPML, the changes did not appear in the string translations. Additionally, text domains were not being scanned correctly, and even after correcting an incorrect text domain, the old one still appeared in the list of text domains for their theme.
Solution:
We recommended the client to follow a guide on translating PHP strings, which can be found here: https://wpml.org/documentation/support/translating-the-theme-you-created/.
Furthermore, we advised the client to check a specific reply that outlines steps to resolve issues with string translation not working for some admin strings, which can be accessed here: https://wpml.org/forums/topic/string-translation-not-working-for-some-admin-strings-checkout/#post-10964017.

If the solution provided is not relevant due to being outdated or not applicable to your case, 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. Should you need further assistance, please do not hesitate to open a new support ticket. You can reach the WPML support forum here: https://wpml.org/forums/forum/english-support/.

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 2 voices.

Last updated by Osama Mersal 1 year, 11 months ago.

Assisted by: Osama Mersal.

Author Posts
March 6, 2024 at 11:05 am #15378609

rolandJ-2

I have made some changes to various PHP files in my theme, but even after rescanning the files in WPML, they don't show up in the string translations.

Also, text domains are not scanned correctly. I had an incorrect text domain "und", fixed it in the file and it still is in the list of text domains of my theme. Seems to not pick up any changes.

March 6, 2024 at 11:22 am #15378663

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English )

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

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

Please check this guide to learn more about translating PHP strings. (https://wpml.org/documentation/support/translating-the-theme-you-created/)

Also, please check this reply and apply the steps mentioned there. (https://wpml.org/forums/topic/string-translation-not-working-for-some-admin-strings-checkout/#post-10964017)

Best regards,
Osama

March 6, 2024 at 12:33 pm #15379211

rolandJ-2

I'm not sure you read my question.
I know how to make translatable strings, which is clearly as a string was registered but changes are not reflecting even after rescanning the theme.
I had this line
<th><?php _e('ID', 'und'); ?></th>
and the "und" was correctly recognised. I have now changed it to
<th><?php _e('ID', 'unc'); ?></th>
but - even after multiple re-scanning - it still shows as "und". This, although the highlighted line clearly states "unc", see image.

Screenshot 2024-03-06 at 14.32.18.png
March 6, 2024 at 12:46 pm #15379293

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English )

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

Hi,

Thanks for your update. Please let me know which file contains this string.

Also, I would need to request temporary access (WP-Admin and FTP)
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website ❌

✙ I would need your permission to de-activate and re-activate the Plugins and Theme and change site configurations. This is also why the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

Best regards,
Osama

March 6, 2024 at 1:09 pm #15379443

rolandJ-2

Unfortunately due to the private nature of data on the website, I cannot give third parties access to this site.

The file on the server has clearly been changed (even WPML shows this) but the text-domain is not updated on the "Theme and plugins localization" page. How can I force this?

March 6, 2024 at 1:20 pm #15379575

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English )

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

Hi,

Please go to WPML-> Theme and Plugins Localizations, add the text domain to "Automatically load the theme's .mo file using 'load_textdomain'", and save. (Kindly check the attached screenshot)

After that, please scan the theme for strings.

Best regards,
Osama

2024-03-06_15-18-52.jpg
March 10, 2024 at 10:43 am #15392396

rolandJ-2

Not really resolved but not really helpful.