Skip to content Skip to sidebar

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.

Tagged: 

This topic contains 2 replies, has 1 voice.

Last updated by samM-17 8 months, 3 weeks ago.

Assisted by: Osama Mersal.

Author Posts
March 1, 2025 at 8:58 am #16763466

samM-17

Background of the issue:
I am trying to resolve an issue where one of our archive pages for a custom post type is not loading string translations. I have used the Query Monitor plugin and found that the text domain is not being loaded for that archive page, unlike others. I have scanned the theme for strings and confirmed that the post type is marked as translatable. Some strings are the same between the working and non-working pages, e.g., __('Category:', 'my-child-theme'). The issue is only appearing in our production environment.

Symptoms:
The text domain is not being loaded for a specific archive page, resulting in text remaining in the original language (English) instead of being translated.

Questions:
Why is the text domain not being loaded for the specific archive page?
What can be done to ensure the text domain is loaded and translations are applied?

March 1, 2025 at 12:05 pm #16763879

samM-17

I've done some further investigation and found that when I add an mo file for the theme into the wp-content/languages/themes directory then WPML seems to realise that it should inject the string translations and then overrides what is in the MO file. This isn't a fix as I might as well not use WPML for this if I have to put an MO file in.

March 3, 2025 at 3:02 am #16766639

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

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

Hi,

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

First of all, sorry for the late reply; it was due to a higher workload.

Please go to WPML-> Support-> Troubleshooting and click the "Show custom MO Files Pre-generation dialog box" button.

After that, please go to WPML-> String Translation and translate the strings.

Best regards,
Osama

March 3, 2025 at 8:24 am #16767259

samM-17

Thanks. Because manually adding an mo file fixed the issue I'm unable to confirm your steps also fix is. Is this a known issue and what you've provided is a known fix?