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.

This topic contains 17 replies, has 2 voices.

Last updated by Itamar 4 years, 7 months ago.

Assisted by: Itamar.

Author Posts
June 19, 2020 at 12:01 pm #6411887

verhuurA

I am trying to:

Link to a page where the issue can be seen:
I will send it in a private message

I expected to see:
mydomain/accommodation/my-property/?lang=nl
mydomain/accommodation/my-property/?lang=de

Instead, I got:
mydomain/accommodation/my-property/?lang=nl%2F
mydomain/accommodation/my-property/?lang=de%2F

June 19, 2020 at 3:59 pm #6413637

verhuurA

Sorry to disturb you but I am pretty much in a hurry to solve this! I have to deliver a project and the only thing in the way is this issue!!

Thnx in advance

June 22, 2020 at 8:36 pm #6429469

verhuurA

Anybody?

June 22, 2020 at 9:01 pm #6429509

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi.

I'm enabling a private message for the next reply. Please share with me the link to your site and the debug information of your site.

Please share your Debug information with me?
You can read a detailed explanation about it here.
http://wpml.org/faq/provide-debug-information-faster-support
The debug info will give me a lot of information about how your site is configured and will help me understand the source of the problem.

Thanks,
Itamar.

June 26, 2020 at 8:33 am #6459775

verhuurA

Hello Itamar,

Sorry for the delay! I have setup a seperate demo site, so you and your theme can investigate the issue.

Please let me know how I can send you the wp login details and ftp details.

Thnx Marc

June 27, 2020 at 7:52 pm #6467811

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Marc

Currently, I can not see the problem on your site.
If I go here for example I don't see the %2F
hidden link

You also said that is happening in Dutch the default language of your site. But since it is the default language a URL like the following is not needed.
hidden link
All this makes me a bit confused regarding to what is exactly the issue that you bring.

If you need further help with this, please share the access details to your site with me and explain to me how to see this problem on your site. I'm enabling a private message for the next reply.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- - Please make a backup of site files and database before providing us access. --

Thanks,
Itamar.

June 29, 2020 at 12:06 pm #6476069

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Marc, and thanks for the access details.

I can see the issue on your site.

It looks like the Demo Home listing was created in English and then translated into German and Dutch. Is this correct?

The default language of your site is Dutch. Was it English in the beginning and then you changed it?

I did go ahead and check what happens when I create the listing first in Dutch and then translate it into English. But it seems that the issue persists.

I see that you are using our Advanced Custom Fields Multilingual bridge plugin for ACF. But the ACF plugin is not installed on your site. Is there a special reason for this?

Please proceed with the following procedure. I suspect that there is a collision with the theme or another plugin that might cause this problem. If possible get your site into a minimum environment. Minimum environment, in your case, means switching to the parent My Listing theme no plugins activated except WPML. You will need first to check if the problem persists when just the theme is switched to the parent theme. If it persists then deactivate all plugins except the WPML and its add-ons. Then please check if the problem persists. If it does not persist so start by activating the plugins one by one and check when the problem comes back, then report to me which was the culprit plugin.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****


*** If your site is a live site you might want first to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***

Thanks,
Itamar.

June 29, 2020 at 5:52 pm #6479643

verhuurA

Hi Itamar,

I just finished a complete new wordpress install in dutch language. I installed WPML as usual and selected dutch as main language. Then I installed my-listing theme. I did not install any other plugins.

I added a new listing. Then i went to wpml translation manager and duplicated the listing for english and german.

On the front end I have exactly the same issue. It does not switch the listing to any other language?

Marc

My question to you is this.

As i use always the same slug for the listings from "My listing theme" maybe you can provide a piece of code that can switch language based on that specific slug..

Let me explain:

The domain is for example mydomain.com

when selecting a listing the structure is always this:
mydomain.com/object/%postname%/ --> this is listing base permalink and the title of the listing

When clicking a flag the only thing that WPML has to do is adding the right language to the url.. so I would think of removing everyhing after /%postname%/ and adding the right /?lang= for the selected flag.....

you will get:
mydomain/object/%postname%/?lang=nl
mydomain/object/%postname%/?lang=en
mydomain/object/%postname%/?lang=de

Just try to think with you to find a solution. This structure only must work for listings offcourse..

Marc

June 30, 2020 at 11:14 am #6485395

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Marc.

I'm sorry but providing such custom code is out of the scope of this support forum.

We have extensive information for developers at the following link.
https://wpml.org/documentation/support/
And we have API hooks which you can use here.
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/
Alos other relevant developers' documentation might be found here.
https://wpml.org/documentation/support/achieving-wpml-compatibility-for-your-themes-and-plugins/
https://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/
If something is not working for you with one of our hooks and you can show us what is not working, we'll investigate why it is happening and advise you how to use it or fix it if from our side needed.

It would be great if you could contact the authors and urge them to join our Go Global Program. You can find details about it here.
https://wpml.org/documentation/theme-compatibility/go-global-program/
We will be happy to cooperate with the authors in making their plugin officially compatible with WPML.

Best Regards,
Itamar.

June 30, 2020 at 11:27 am #6485495

verhuurA

Hi Itamar,

To be honest I am a bit disappointed. If i was the creator of this plugin I would show more interest in finding a proper solution even it would not be in the scope of support. I would want to know why my product is not working.. but hey.. that's just me.

Basically it was a waist of precious time setting up all those demo sites in order for WPML to test the plugin. I did what was asked and now I feel left behind with the same problem.

Marc

June 30, 2020 at 12:02 pm #6485765

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Marc.

I'm sorry if my judgment on how to proceed with looks wrong in your eyes. Since you asked for a custom solution I only referred to your request. Or maybe I misinterpreted you. In any case, let's replicate this issue on a fresh WordPress installation on our servers and I'll then escalate it to our compatibility team to see if they can find a fix for this issue. I want to stress that what they would try to find is a fix, either from WPML's side or something that can be wicked in the theme's files. So it would be a fix, if possible, and not a custom code solution.

I created a test website with a clean WordPress install. You can access it through this link:

hidden link

With this link, you'll be directly logged in.

Could you please install the My Listing by 27collective and see if the issue is replicable on a clean WordPress installation?
Please configures WPML as it is set on your site.
Please also make sure that you are installing the latest version of the theme.

When everything is finished, and you can replicate the problem, please let me know.

P.S. On a personal note, I want also to mention that if the author the theme is noting that the theme is not compatible with WPML, you should seriously consider if you want to use it on this multilingual project. I say it because there might be issues that you still have not encountered which might show later on when the site will be in production.

Best regards,
Itamar.

June 30, 2020 at 12:45 pm #6486053

verhuurA

Hi Itamar,

Just to let you know, all is working fine except the part we are discussing here. The reason i send you about custom code is not for you to develope a whole new thing, just to share idears how this issue coud be solved on a short term.

If the url is constantly the same exept for the post title I could imagine that it should not be hard to provide a piece of code or a aa_filter in functions.php that does nothing else than if the following information is in the url

mydomain.com/demo/object/%postname% that in that case it always add the language parameter and refreshes the page. so you will get

mydomain.com/demo/object/%postname% / ?lang=nl
mydomain.com/demo/object/%postname% / ?lang=en
mydomain.com/demo/object/%postname% / ?lang=de

I was hoping that this would be a fairly simple process and could resolve it for just now. I will not use the site any otherwise... the only thing that differs is %postname%

I have installed my-listing theme for you on the demo. I cant reproduce all yet as this piece of code needs to be added to functions.php

You find code below.

PS: this was also shared by your development team.. Thats why i was hoping for a simular piece of code for this problem... which was addressed in the same ticket.

if (is_admin()) {
add_action('admin_enqueue_scripts', 'wpml_dequeue_theme_scrpit', 31);
add_action('elementor/editor/after_enqueue_scripts', 'wpml_dequeue_theme_scrpit', 11);

}
function wpml_dequeue_theme_scrpit()
{
if ('wpml_page_sitepress-multilingual-cms/menu/taxonomy-translation' === get_current_screen()->id
|| 'wpml_page_wpml-translation-management/menu/main' === get_current_screen()->id) {
wp_dequeue_script('theme-script-main');
}
}

June 30, 2020 at 1:33 pm #6486519

verhuurA

Hi Itamar,

Forget my comment about functions.php I have fixed that through wp-admin.

I think its setup as I use it. I have One listing and you can use homepage and search page. The rest i did not bother as it is irrelevant.

You can click on the listing and try to switch language. I have only the footer language switcher enabled.

Marc

July 1, 2020 at 10:22 am #6493925

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Marc, and thanks for replicating the issue on the sandbox site.

I can see the issue on the sandbox site. I also tried various options that included settings of WPML and permalinks, but couldn't find a workaround for this issue.

I'm discussing this issue with our compatibility team to see if there is anything that we can do with this issue.

Meanwhile can you please update the theme to its latest version and see if by any chance it is fixing the Language Switcher issue?

I can see that a new version was just recently released -> v2.4.7 – 28 June 2020
hidden link

Thanks,
Itamar.

July 1, 2020 at 10:50 am #6494319

verhuurA

Hi Itamar,

I have updated to the latest version of My Listing.

I want to mention one thing that might be of interest for this issue...

When i start I have the listing type. This holds the information of the listing.

The listing type is translatable to the other languages and so i do that in the way like everything else with WPML. I duplicate the content of dutch to the other languages.

In my case the slugs of the listing types are

NL --> vakantieverhuur
EN --> vacation-rentals
DE --> ferienwohningen

So far so good..

To get My listing to work multi-lingual in my case is by adding a listing in let's say dutch.. I provide all the details neccessary. After all is in place I go to the translation management tool of WPML

I select listing and select the listing that i want to duplicate. I press the button duplicate.
Now comes the tricky part...

When the listing is cloned to the other languages it will hold the same listing type: in my case "vakantieverhuur" as i add the listings in dutch.

The way to solve the information is displayed correctly is to go to the listing in lets say English. When I open the listing I have to press the button "Translate independently"

After this is saved I then have to set the listing type to vacation Rentals in order to show the content in english. After i choose the listing type I have to store it by using the update button.

Now you have a better understanding of the way WPML is used in combination with my-listing and hopefully is some kind of solution or workaround.

Marc