Skip Navigation

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

Problem:
The client has a multilingual site with English and Dutch languages. They noticed that while the content was translated by WPML, the URLs in the static HTML custom "menu" were not updated to point to the corresponding translated pages. The client wanted to know if there is a setting in WPML that automatically redirects users to the translated version of a page when they are on the Dutch homepage and click a link that has a Dutch translation available.

Solution:
We informed the client that static HTML cannot be translated by WPML. Only PHP code that includes proper GetText calls can be translated within WordPress. Therefore, to achieve the desired functionality, the client would need to update the static HTML links manually to point to the correct translated pages. We also provided a guide on how to translate themes created by the client, which can be found here:

If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. We also 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 further assistance is needed, please contact us in the 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 10 replies, has 2 voices.

Last updated by Andreas W. 1 year ago.

Assisted by: Andreas W..

Author Posts
February 8, 2024 at 7:20 pm #15283078

johnM-108

There's probably a simple answer to this, but I couldn't find a solution online.

My example:
I had a site that was English only and I've used WPML to create a Dutch version of the site. WPML translated the text of the content but the URLs were not changed.

For example, on the English homepage, there is a link to the About Us page that links to the English About Us page. WPML translated the text of the page for the Dutch version of the homepage, but the link for "About Us" still links to that original English version of the page.

Now, we have also translated that About Us page to Dutch, so my question is....

If a person is viewing the Dutch homepage (at the /nl/ sub domain) and clicks a link to an English page WHICH HAS a Dutch translation available, is there a setting that will force the person to the Dutch page?

Or, do I just have to update all the content-area based links throughout my site manually?

February 8, 2024 at 7:54 pm #15283162

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Are you refering to the menu or the content?

For the menu, please go to WPML > WP Menus Sync and run the dialog.

If you use a custom link in your menu, then please adjust the link directly inside the translated menu.

Menu translation guide:
https://wpml.org/documentation/getting-started-guide/translating-menus/

About the content:
WPML will by default not display internal links on the Advanced Translation Editor unless you use page builders that work with shortcodes.

It looks as if you are using Gutenberg Blocks, correct?

Did you already try to edit and save the original content and then apply the translation again?

While doing this please revise if the link is not displayed on the Advanced Translation Editor, or if it is, then please translate it accordingly using the second language URL for the content.

If this will not solve the issue, please let me know.

Best regards
Andreas

February 9, 2024 at 3:38 pm #15286874

johnM-108

This didn't address my question. Let me try again.

On my site, I have an English and a Dutch version of a page:
English: hidden link
Dutch: hidden link

My question is whether or not there a setting in WPML so that if:
1. A visitor is viewing a Dutch page (for example the Dutch version of the homepage -- hidden link) and
2. he clicks a link to an English version of a page (hidden link) THAT HAS a Dutch translation available (hidden link)
3. he will be sent to the Dutch version of the page because he was ON a Dutch translated page

February 9, 2024 at 4:50 pm #15287052

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

As long a visitor is on a Dutch version of your site, the internal links should always redirect to Dutch content unless the visitor uses the language switcher to navigate to another language.

If the language switcher is used, WPML will redirect to the translation of the current content or redirect to the homepage in the selected second language if no translation exists.

February 9, 2024 at 5:13 pm #15287167

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

My apologies, as I by mistake posted another reply that was related to another ticket. I have removed this comment now.

Let me know if you do have further questions or if WPML is not working as expected on your site.

February 9, 2024 at 5:42 pm #15287223

johnM-108

We are not using a language switcher that WPML provides. We use a custom menu that simply directs users to the site URL that corresponds to the language. You can see that in the "Global Locations" drop-down menu at the top of: hidden link

Does custom navigation like this omit some functionality in WPML? Because it's not behaving like you describe.

February 9, 2024 at 6:20 pm #15287254

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

This depends on how the menu was created.

If you link towards pages dynamically, then WPML should be able to adjust those links by going to WPML > WP Menus Sync.

In case you use custom links in your menu, then you will need to edit those links in each menu accordingly or translate the links at WPML > String Translation.

Please read this guide:
https://wpml.org/documentation/getting-started-guide/translating-menus/

February 9, 2024 at 7:12 pm #15287366

johnM-108

I am not talking about the site menus which use WP Core menu functionality. Those are fine.

The custom "menu" I'm referring to above in Reply #15287223 is not a WP Core menu, it's just code with links to the following places:
hidden link
hidden link
hidden link

If you click the link in that reply and click the "Global Locations" item at the top of the site, you'll these are direct links to the different sites.

So, this is not a WPML "language switcher" widget or anything like that, in case that widget does something other than simply direct a person to a different URL.

Would directing people directly to those URLs omit the functionality I see missing?

February 9, 2024 at 7:44 pm #15287442

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

How is this menu coded? Could you please provide me with an example?

February 9, 2024 at 7:49 pm #15287448

johnM-108

It's static HTML.

February 9, 2024 at 8:10 pm #15287464

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

You can sadly not translate static HTML. Only PHP code with proper GetText Calls is translatable in WordPress.

Guide:
https://wpml.org/documentation/support/translating-the-theme-you-created/

February 10, 2024 at 1:20 pm #15288533

johnM-108

I'm asking about links in the content area of the page and all I'm asked about are the menus, which I specifically state are not the topic of my question.