Skip Navigation

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

Problem:
You are experiencing an issue where a hardcoded string 'Built for the New Reality' on your homepage is not displaying its French Canadian translation on the live site, despite working on the staging site. You've tried saving the page, syncing theme translations, updating the translated string in String Translation, and clearing the page cache.
Solution:
We noticed that WPML could not write to the

/wp-content/languages/wpml

folder, which prevents it from generating the .mo files necessary for displaying translations. To resolve this, please ensure that WPML has the necessary permissions to write to this folder. You can do this by following these steps:
1. Visit the WPML documentation on .mo file generation.
2. Navigate to WPML → Theme and Plugins Localization.
3. Generate the .mo files.

If this solution does not resolve your issue or seems irrelevant 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. If needed, please do not hesitate to open a new support ticket for further assistance 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.

This topic contains 9 replies, has 0 voices.

Last updated by Andrey 1 week, 2 days ago.

Assisted by: Andrey.

Author Posts
May 15, 2025 at 6:37 pm #17038440

jeremiahH

Background of the issue:
I have a string on the homepage that is hardcoded in the theme, 'Built for the New Reality'. We have the French Canadian translation yet it is not showing it on the site when viewing in French Canadian. I have tried saving the page, sync theme translations, changing the translated string in String Translation, and cleared page cache. I am seeing the translated string on our staging working fine, just for some reason not on our live site.

Symptoms:
Translated hardcoded strings are not appearing on the live site in French Canadian.

Questions:
Why is the translated string not appearing on the live site?
What steps can I take to ensure the translation appears correctly?

May 15, 2025 at 9:20 pm #17038809

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for contacting WPML support.

Can you show me where and how it was hardcoded in the screenshots? I want to ensure that I fully understand this so that I can provide the best possible solution. You can also share the code here where it is hardcoded.

May 16, 2025 at 8:05 pm #17043318

jeremiahH

Hi Andrey,

I've attached the screenshot of the template and the snippet below:

<div class="homepage-feature">
<p class="home-intro"><?php the_field('header_text'); ?></p>
<p class="banner-values"><?php _e('Built for the New Reality', 'html5blank'); ?></p>
<?php $button = get_field('button') ?>
">


</div>

I also sent a screenshot of the String Translation dashboard and it shows that it recognizes the "Built for the New Reality" string and where it should be appearing.

Screenshot 2025-05-16 at 1.03.40 PM.png
Screenshot 2025-05-16 at 1.03.33 PM.png
Screenshot 2025-05-16 at 1.03.23 PM.png
Screenshot 2025-05-16 at 1.02.17 PM.png
May 16, 2025 at 8:18 pm #17043453

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

Do you load the html5blank textdomain somewhere in your current theme? For example, https://codex.wordpress.org/I18n_for_WordPress_Developers#Loading_a_Text_Domain .

You can also try to load the textdomain in WPML → Theme and plugins localization → Localization options.

May 21, 2025 at 6:33 pm #17058752

jeremiahH

Hi,

We do load the html5blank textdomain in our functions.php like so:

function html5blank_load_textdomain() {
load_theme_textdomain('html5blank', get_template_directory() . '/languages');
}
add_action('after_setup_theme', 'html5blank_load_textdomain');

I did just have to update it because I noticed it was in an odd function that was:
if (function_exists('add_theme_support')) {}

I moved it out of this and updated to the first snippet where it loads after theme setup. That also works with out sites where we have WPML.

I did run theme localization again but it hasn't updated it. I also tried saving the page and clearing my site cache. But it still hasn't updated.

May 22, 2025 at 2:21 pm #17062332

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for the details.

I need to request temporary access (wp-admin and FTP) to your site—preferably to a test site where the problem has been replicated if possible—in order to be of better help. When you log in to leave your next reply, you will find the needed fields below the comment area. The information you will enter is private, meaning only you and I can see and access it.

May 23, 2025 at 4:46 pm #17067464

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for providing the details.

I noticed a message in the screenshot indicating that WPML cannot write to the /wp-content/languages/wpml folder, which prevents it from generating the .mo files. This could be one reason why the translation isn't working.

Could you please follow the link below? Then, go to WPML → Theme and Plugins Localization and generate the .mo files.

https://wpml.org/faq/cannot-write-mo-files/

Screenshot 2025-05-23 at 19.39.41.png
May 23, 2025 at 10:08 pm #17067974

jeremiahH

Ohh okay thank you. I'll be out this coming Monday but we'll go ahead and update permissions to allow the folder to be writeable. I should respond Wednesday morning and let you know if this works. Thank you!

May 26, 2025 at 7:45 am #17071281

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Sure, thank you. I hope it helps 🙂

Let me know how it goes.

May 28, 2025 at 6:12 pm #17085116

jeremiahH

We updated permissions and that worked! Thank you!

May 28, 2025 at 6:22 pm #17085152

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Great! I am glad to hear this 🙂 Have a nice week!