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 13 replies, has 2 voices.

Last updated by Bobby 2 years, 10 months ago.

Assigned support staff: Bobby.

Author Posts
December 8, 2017 at 7:27 pm #1453212

natcharinthornA

I am using WPL with WPML but Realtyna has referred me to you. As of about two hours ago, the language switcher is not generating correct URLs on the WPL listing pages.

Previously URLs such as this: hidden link would have "?lang=sv" appended to the end and the translated version would show perfectly. Now however, the WPML translator is placing the "?lang=sv" after the initial category, instead of at the end.

The WPML language switcher used to do this, allowing me to hop back and forth:
hidden link
hidden link

However now when using the language switcher (while on the same URL as above, for example) it leads visitors to broken pages, instead of translations:
hidden link
hidden link

December 8, 2017 at 7:42 pm #1453219

natcharinthornA

Here is a screenshot to demonstrate how it is adding "?lang=sv" into the middle of the URL, instead of the end

December 11, 2017 at 11:38 am #1454095

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

As a test please go to WPML->Languages->Add footer language switcher and test with the footer switcher.

=> what are your results ?

Also go to WPML => Support , and click on "Troubleshooting" while in the Troubleshooting page please perform the actions. (specifically "set language information" but i recommend performing all of them"

December 12, 2017 at 4:15 pm #1455865

natcharinthornA

Greetings Bobby,

Issue remains regardless of which position the language switcher is placed. And as suggested, I also performed the clean ups, all except for "synchronize post taxonomies" because our taxonomy structure is different and I worry that might break everything.

However, hopefully these facts should help pinpoint/resolve the issue:

1) The URL error only happens on the WPL listings pages -- not blog posts or WP pages/tags/cats.
2) As I mentioned when opening the ticket, the issue first appeared 2hrs prior. However it had been working perfectly since installing WPML Pro months ago. (One of the reasons Realtyna immediately referred me to you.)
3) Prior to the initial appearance of said issue, my Swedish assistant manually SEO'd the translated versions of several Swedish pages in order to get "green lights" from WordPress SEO.
4) This manual editing did not cause any issues to the translation display/links of any other pages, however the timing cannot be a coincidence.
5) The Swedish version of the "property" page -- "boende" -- was one of these edited. It is the template for WPL listings pages, the only section this error is occurring.

I suspect that when the "boende" page was SEO'd the manual save overwrote/created new strings in WPML that broke the translation link structure for every page using the "boende" template.

To attempt to rectify this situation:
- Reverted to the original revision of the "boende" page, but that made no difference.
- Deleted the "boende" page and made a new translation from the original "property" page. No difference.
- Renamed the Swedish "boende" slug to "property" hoping that if the URL was maintained intact, the language link would remain intact as well. Then I tried going back to WPML troubleshooting and running more clean-ups but no luck.

Attached are screenshots of the WPML translation footer and the page in question after I changed the slug from "boende" to "property" -- I'm leaving it like this for now and not making any additional changes until this is resolved.

Any ideas?

December 12, 2017 at 6:55 pm #1456054

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

If possible i woud like to take a closer look

**Before we proceed I recommend to please take FULL BACKUP of your database and your website.**
I often use the Duplicator plugin for this purpose See: http://wordpress.org/plugins/duplicator/

I would like to request temporary access (wp-admin and FTP) to your site to fix the issue.
(preferably to a test site where the problem has been replicated if possible)

You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you will enter is private which means only you and I can see and have access to it.

Thank you,
Bobby

December 13, 2017 at 6:00 pm #1457183

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you !

I am currently testing this and will be updating you shortly !

December 14, 2017 at 12:12 am #1457381

natcharinthornA

Thanks Bobby, will be eagerly awaiting your next response. Appreciate it! Cheers

December 14, 2017 at 10:00 am #1457606

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

I noticed that within WPL->Settings->Languages you do not have it enabled to be multilingual

Please enable it and also follow the instructions in the following documentation .

Let me know your results.

hidden link

December 14, 2017 at 2:24 pm #1457967

natcharinthornA

To be honest, WPL->Settings->Languages has ALWAYS been disabled. Translating 100s of apartment descriptions was never our intention -- only the core pages, widgets and blog.

This is why Realtyna (the makers of WPL) referred me to you for this issue, and the case was opened.

Do you still wish for me to proceed with this route when I can guarantee you that this had no affect on the sudden appearance of my issue.

December 14, 2017 at 5:55 pm #1458262

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I can provide you with a quick fix

Since the location of the added language parameter is in the middle of the URL instead of the end for these properties , i suggest using Different languages in directories which fixes the issue.

I have already set it to use the directories so please review and let me know your thoughts.

hidden link

December 25, 2017 at 10:34 pm #1465651

natcharinthornA

Sure, am fine with using the /sv/ directory. However before I go around and begin updating links, the page you provided loads correctly but try to use the language switcher -- it is still broken. On the property listings it still links to hidden link instead of the full URL, directory or not.

December 26, 2017 at 1:22 pm #1465888

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

If you go to Your Homepage -> Switch to SV language - > For Sale then you are able to access all properties normally.

which before was a problem because when you would switch back to the Swedish version of the properties page you would not be able to access the properties due to the permalink showing as such

hidden link

this has been fixed and now the only problem is switching with the language switcher because it will not link to the property but instead take you back to the main properties page.

This is fixed by going to WPL->Settings->Languages you do not have it enabled to be multilingual as mentioned before and enabling it.

This will allow the plugin to work correctly with WPML.

Please review your properties now and also my screencast.

hidden link

December 27, 2017 at 1:42 am #1466243

natcharinthornA

Hey Bobby,

Just getting WPML to work within the basic WP framework itself has been a two month struggle and learning process. I do not want or need to translate anything within the properties pages -- only the WP blog posts/categories/tags and a few select pages. That's why everything was set the way it was. That is also why WPL multilingual was disabled from day one and the translation switcher still always worked.

However, as mentioned above, immediately after the Swedish translation of the Property page (boende) was manually saved, the language switcher broke. Before that the switcher had been fine since installation. (And as I also already mentioned above, a quick revert to the prior saved version of the Swe page in question did not solve the problem -- something happened when that page was saved, somewhere a new WPML field was created that is breaking the automatic URL generation provided by WPL by default, even if it is not configured for multiple languages.)

Additionally, if we keep the /sv/ directory then the entire sitemap and internal links have to be rebuilt, and 301 forwards created. I much prefer the ?lang=sv ending, for that and other reasons. And the switcher has always worked fine with ?lang=sv at the end *even though* when editing a post/page in the WP backend it would *show* the URL as hidden link *however* the URLs were always rendered properly, that's just a bug in the way its displayed on WordPress.

I only ever saw this area in the backend -- were you able to actually make it happen on the frontend, during live browsing? If so, I understand your justification for making the switch. But if it's purely a harmless aesthetic glitch in the backend only then we should revert back to ?lang=sv because I'm getting a lot of 404s now....

December 27, 2017 at 8:01 am #1466314

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

The setting in WPL needs to be enabled if you have a multilingual site, and i highly recommend leaving it enabled , you dont need to translate anything in the properties pages for it to remain enabled.

The correct language url format to be used is "languages in directories" and as you have seen in my screencast it worked quite well with it.

It is best to use "directories" as it works best.

Also i would like to mention that there is a specific way this plugin is meant to be used in order for it to be functional with WPML.

When using it the way i set it up everything is working as expected and i am currently not able to get any 404 errors.

If you would rather use the url format as parameter , it will work OK but it will cause issues in the front end as the permalink is added in the middle of the URL.

If possible please contact the WPL authors about this as well as they might be able to provide more information why this is happening.

It is important to note that everything in the following article has to be followed correctly even if you are not goign to translate your content.

hidden link