Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 -
- 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 -

Supporter timezone: Asia/Kathmandu (GMT+05:45)

Tagged: 

This topic contains 0 replies, has 0 voices.

Last updated by BlogAdmin 20 hours, 27 minutes ago.

Assisted by: Shekhar Bhandari.

Author Posts
February 5, 2025 at 4:39 am

BlogAdmin

Background of the issue:
I’m working with Transperfect/GlobalLink/Translation.com to update the website translations. I moved to Prod after testing on Dev, but the Header and Footer (including navigation, patterns, etc.) aren’t translating correctly on Prod. I am only translating from English to Dutch on one page and one post so far. They’re showing up like this: nu003cspan class=u0022wpml-ls-nativeu0022 lang=u0022enu0022u003eEnglishu003c/spanu003e nu003cspan class=u0022wpml-ls-nativeu0022 lang=u0022pt-bru0022u003ePortuguêsu003c/spanu003e

Symptoms:
The Header and Footer (including navigation, patterns, etc.) aren’t translating correctly on Prod.

Note: The first three rows of the screenshot shows blank in the columns with Transperfect and the Action.

Questions:
Any suggestions on how to get the navigation to translate properly?

February 5, 2025 at 6:08 am
February 5, 2025 at 6:10 am #16669041

BlogAdmin

Is this message private?

Once it is copied over, staging login will be
hidden link

February 5, 2025 at 6:29 am #16669049

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

The staging is not working for me as it redirects to the main site, can you check?

Look forward to your reply.

Thanks

February 5, 2025 at 10:44 am #16670333

BlogAdmin

The website copy site was completed successfully, but it looks like the language switcher is not in the navigation menu. Did you already make changes, or did the site not copy completely? What information do you need from me?

Thanks

February 5, 2025 at 11:04 am #16670467

BlogAdmin

hidden link

February 5, 2025 at 11:56 am #16670844

BlogAdmin

The Navigation Language Switcher was removed somehow, I added it back to both prod and staging. Thanks!

February 5, 2025 at 1:26 pm #16671279

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

I’ve conducted multiple tests but haven’t been able to identify the conflicting template or pattern causing the issue. The pages are using the "page" template, while the page template translations rely on a header pattern that contains the incorrect switcher. However, even after adjusting the translation, the layout still doesn’t function as expected as reusable blocks is not shown.

To investigate further, I’d like to perform a more in-depth review. Could you please provide a backup of your site's wp-content folder along with the database? This will allow me to replicate your site on my local environment and carry out detailed debugging.

You can zip those files and share the links with me using some file sharing platform, I have enabled the private reply for you.

I look forward to your response.

Thanks

February 6, 2025 at 4:27 am
February 6, 2025 at 10:06 am #16674620

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello,

As mentioned earlier, I’ve tried several approaches in the staging environment but haven’t been successful. Without backups to debug locally, resolving the issue will be quite challenging and time-consuming. I hope you understand.

I recommend deleting the current staging site and setting up a new one so I can retest the issue. Additionally, please note that we might need to recreate the staging environment again for further testing in the future.

I look forward to your response.

Thank you.

February 6, 2025 at 2:15 pm #16675952

BlogAdmin

Sure! I'll copy prod to staging and let you know when it's done. Thanks!

Just a thought— could it be useful to look into the differences between Dev, which is working, and both Production and Staging, which aren’t?

February 6, 2025 at 8:02 pm #16677049

BlogAdmin

A new staging environment has been created from prod. Please let me know of next steps. Thanks

February 7, 2025 at 8:17 am #16678210

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

Can you provide me the staging login details? Is it the same url as before?

Look forward to your reply.

Thanks

February 7, 2025 at 9:02 am #16678356

BlogAdmin

Yes, it should be the same url and password as before, let me know if you need me to reset the password.

February 7, 2025 at 12:27 pm #16679608

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

Upon further debugging I found out that all the templates, pattern, blocks, template part translations was set as draft resulting in the error.

To fix this, I used this custom snippets

function publish_all_custom_post_types() {
    $post_types = ['wp_block', 'wp_template', 'wp_template_part', 'wp_navigation']; // List of post types to update

    foreach ($post_types as $post_type) {
        $args = array(
            'post_type'      => $post_type,
            'post_status'    => 'draft',
            'posts_per_page' => -1, // Get all drafts
        );

        $draft_posts = get_posts($args);

        if (!empty($draft_posts)) {
            foreach ($draft_posts as $post) {
                wp_update_post(array(
                    'ID'          => $post->ID,
                    'post_status' => 'publish',
                ));
            }
        }
    }
}

// Run the function automatically in the admin area
add_action('init', function() {
    if (is_admin() && current_user_can('manage_options')) {
        publish_all_custom_post_types();
    }
});

I suggest you to use the code once and remove it, also, try this after a backup and let me know if this helps.

Thanks