Skip Navigation

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

Problem:
If you're experiencing inconsistent string translations in your theme, where some strings are translated while others are not, and enabling 'Look for strings while pages are rendered' only temporarily solves the issue.
Solution:
We recommend checking and updating your theme's localization setup:
1. Ensure your theme's

style.css

includes a proper text domain, for example:

Text Domain: blank

2. Add the

load_theme_textdomain

function to your theme's

functions.php

file, ideally around line 413:

load_theme_textdomain('blank', get_template_directory() . '/languages');

3. Create a 'languages' folder in your theme directory.
4. Update the text domain in your theme's header code to match the one you've set, like so:

<?php _e('Zvani', 'blank') ?>:

After making these changes, scan and translate your theme again to check if the issue is resolved.

Please note that this solution might be outdated or not applicable to your specific case. If the problem persists, 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. If needed, please open a new support ticket at WPML support forum for further assistance.

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

Last updated by aigarsM 1 month ago.

Assisted by: Shekhar Bhandari.

Author Posts
February 5, 2025 at 8:11 am #16669341

aigarsM

I understand. Thank you!

Could you please check one more thing? For some reason, string translation does not seem to work consistently—some strings are translated, while others are not.

Enabling "Look for strings while pages are rendered" appears to help, but as I understand, this is only a debugging tool and should not be enabled on a live site.

I would normally create a separate ticket for this issue, but since this site has multiple WPML-related issues that I can't debug myself, I'm including it here along with the previous one.

February 5, 2025 at 8:52 am #16669474

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Can you delete the string and re-translate it to see if it helps?

Also, the previously shared login details is not working, so can you provide the login details in the next private reply.

Look forward to your reply.

Thanks

February 6, 2025 at 8:17 am #16673847

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I made the following changes to make things work properly.

1. Your theme style.css has textdomain set to blank, I set it to blank

Text Domain: blank

2. Your theme doesn't have load_theme_textdomain function enabled, so I added it in your theme functions.php line no.413

load_theme_textdomain('blank', get_template_directory() . '/languages');

3. Then I created a languages folder in your theme directory

4. Then I made the changes to the header code and replaced the domain from OC to blank.

<?php _e('Zvani', 'blank') ?>:

This above steps are part of creating a standard WordPress themes.

Once this changes are done, I scanned the theme and translated it and it's working for me, please check and confirm.

Thanks

February 6, 2025 at 10:59 am #16674890

aigarsM

I understand. I will keep this information in mind moving forward.

What threw me off was that this system is not implemented in my other projects, yet WPML works just fine in those.