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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 13 replies, has 2 voices.

Last updated by Mateus Getulio 17 hours, 1 minute ago.

Assisted by: Mateus Getulio.

Author Posts
May 27, 2024 at 7:57 pm #15675723

boyanK

Hi Mateus,
What I notice is that the links on the buttons on the site load the Bulgarian version, regardless of which other language I am in, do I have to manually set the links for each language separately.

May 27, 2024 at 8:08 pm #15675731

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

I checked it and it looks like the links are added as absolute/full links. In order for WPML to translate it automatically for you, you can edit the links in the main language and set them as relative links. Eg.: I edited the link in the button "Sehen Sie sich die Produkte an" from hidden link to /product-category/viviscal-man/.

After that, I saved the page in the main language, edited the German translation as a test and just saved it as it is. Now when I check the link of that button in the German language, it is pointing to the correct domain.

Please check the screenshots I attached to my reply.

In order to fix it, you need to edit the links in the main language, remove the domain and save them as relative links as shown in the screenshot. Then you edit the translations one by one and just save them as they are without having to edit the translation.

After that the issue with the links should be fixed.

Thank you,
Mateus

linksetting.png
German link.png
May 28, 2024 at 2:39 pm #15679319

boyanK

Hi Mateus,
I did this but only the Greek links work correctly. I don't understand why this is happening since I did the same for all languages.

May 28, 2024 at 8:14 pm #15680855

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Boyan,

I checked the home page in the other languages and it seems to be working now. Did you manage to fix the issue? Or perhaps it was some cache?

Or maybe the issue is happening in a different page?

Thank you, please let me know so I can double-check it.

Kind regards,
Mateus

May 29, 2024 at 8:31 am #15682085

boyanK

Hello, as an example, I am sending a picture of the link in German. Before that I cleared the cache.

May 29, 2024 at 8:45 am #15682151

boyanK

The link does not redirect correctly

Screenshot 2024-05-29 112525.png
May 29, 2024 at 7:30 pm #15685298

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Boyan,

I checked it and the issue with this specific link is that it was created as a custom link.

To see it you can go to Appearances > Menu > Главно - Немски (Main) or please check the screenshot to view it.

I reviewed this issue and the links were incorrect in the menu, to fix it I followed the steps:

- Go to Appearances > Menu > Главно - Немски
- Switch to German in the admin top bar
- Edit the link Viviscal für Männer changing it from hidden link to hidden link
- Edit the link Viviscal für Frauen changing it from hidden link to hidden link

After that I tested it and the links are working correctly.

Please notice that WPML can't automatically adjust custom links. It is possible to translate/edit the URLs and labels of custom links in two ways:

1) Manually from the Appearance → Menu page like I did above.

https://wpml.org/documentation/getting-started-guide/translating-menus/#option-2-translating-menus-manually

2) By syncing the menu structure and then using WPML String Translation to translate the URL and label of the custom menu item.

https://wpml.org/documentation/getting-started-guide/translating-menus/#translating-custom-links

Thank you,
Mateus

menu link.png
May 31, 2024 at 3:14 pm #15693167

boyanK

Thank you Matheus,
I think I can solve the menu problem. Apparently I didn't ask the question correctly. I mean the problem with the links to the buttons. I am attaching a photo. I did what you advised, but only the links in Greek work correctly.

Screenshot 2024-05-31 180545.png
May 31, 2024 at 9:28 pm #15694187

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Boyan,

Thank you for sharing that information, I apologize for the confusion, I was able to see and replicate the issue now.

I'd like to ask permission to make a copy/staging version of your site where I can debug this closely without affecting the live site.

I'll make sure to delete this copy as soon as we get this issue fixed.

I'm afraid of debugging directly on the live site and cause issues to your visitors. Also, it is important to test a different setup as part of the troubleshooting.

Thank you, please let us know.
Mateus

June 3, 2024 at 2:27 pm #15698185

boyanK

Thanks Mateus, please feel free to make a replica of the site. I don't know if it's right to post another case study here, if not, please ignore it. I have chat plugins but it is only active in viviscal.bg and in all other domains of viviskal.store i am not showing up can you advise me how to proceed

June 4, 2024 at 1:20 pm #15702225

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

I checked this out but so far I couldn't find a fix for it.

I asked my colleagues to have a look at this issue in order to see if there's anything I'm missing.

I'll come back here as soon as one of my colleagues reply back to me (which it shouldn't take long).

Thanks,

June 5, 2024 at 8:18 pm #15708694

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

Thank you for your patience while we're investigating this issue.

I have escalated this ticket to our 2nd tier of support where our 2nd tier specialists will take a deeper look at this issue and will try to find a solution.

I will get back to you as soon as I get an answer from them.

Best regards,
Mateus

June 6, 2024 at 11:24 am #15710771

boyanK

Thank you Mateus, I will wait for your reply.

June 19, 2024 at 8:22 pm #15758572

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thank you for your patience while we investigated this issue.

Upon further review, our 2nd tier team identified that those buttons belong to the module et_button and the URL/link is encoded. This was preventing WPML from auto-adjusting those fields.

To fix it, we followed the steps:

- Go to WPML -> Settings -> Custom XML configuration and add the following code:

<wpml-config>
  <shortcodes>
    <shortcode>
      <tag>et_button</tag>
      <attributes>
        <attribute encoding="allow_html_tags">title</attribute>
        <attribute encoding="vc_link" type="link">href</attribute>
        <attribute encoding="vc_link" type="link">link</attribute>
      </attributes>
    </shortcode>
  </shortcodes>
</wpml-config>

- Edit the file: wp-content/plugins/sitepress-multilingual-cms/inc/absolute-links/absolute-links.class.php in the method: \AbsoluteLinks::_process_generic_text right after:

} elseif ( isset( $permalink_query_vars['category_name'] ) ) {
						$category_name = $permalink_query_vars['category_name'];

- add this excerpt before the one above:

} elseif ( isset( $permalink_query_vars['product_cat'] ) ) {
						$category_name = $permalink_query_vars['product_cat'];

This second part is a workaround needed for the links in this button module be properly adjusted, we're working to have this included by default in the next versions, but it is important to check in new updates if the issue comes back so you can apply this workaround again.

After performing those steps, I made a minor change to the home page(added an empty space) and edited all translation, just saving them as they are.

Now, when I check the secondary languages, the buttons look to be pointing to the correct URL.

Can you please test it and confirm?

Best,
Mateus