Support » Plugin: Language Switcher » Post link redirect to the second language instead of its own language.

  • Resolved pop3d

    (@pop3d)


    Hello, I have a website with two languages English and Arabic that is designed/structured as following:

    http://www.websitename.com that is the main site, and it is in English as default language.
    http://www.websitename.com/ar and that is the Arabic version of the website that has its own separate wordpress installed under a sub folder.

    I create a post under the main wordpress (let’s say: http://www.websitename.com/post1_EN), and then recreate the same post in Arabic under the second wordpress inside the subfolder (Let’s say: http://www.websitename.com/ar/post1_ar)

    When I use this plugin I open the English post (www.websitename.com/post1_EN) and set it to English as default language, and enter the url for the Arabic version of the post (www.websitename.com/ar/post1_ar) in the url section for this plugin, to link them together.

    What happens is that when I open the English website (www.websitename.com) and click on the post link to open the post (post1_EN) it instead opens the Arabic version redirecting me to the link (www.websitename.com/ar/post1_ar), while it actually should open the English version (www.websitename.com/post1_EN).

    It’s like the two languages are crossed over, setting one as default makes the links open the other one and vice versa!.

    Why is that happening and how to solve it?, I have wordpress 5.5.1

    Thanks for your help in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author rafasashi

    (@rafasashi)

    Hello pop3d,

    Can you try from an incognito tab with session and posts query filters disabled (checked).

    You can find the options in Languages > Settings

    Also you an feed us back via Recuweb Code Market with the real url by contact form or using the forum thread.

    • This reply was modified 4 months, 2 weeks ago by rafasashi.
    • This reply was modified 4 months, 2 weeks ago by rafasashi.
    • This reply was modified 4 months, 2 weeks ago by rafasashi.
    Plugin Author rafasashi

    (@rafasashi)

    Also you an feed us back at code.recuweb.com with the real url by contact form or using the forum thread.

    • This reply was modified 4 months, 2 weeks ago by rafasashi.
    Thread Starter pop3d

    (@pop3d)

    Hello Rafasashi,

    Thank you for your reply, Sure I believe it would be fine sharing the actual website links (I’m actually managing this website on behalf of a friend) and I also would like to share some weird behavior that I’m seeing from the plugin.

    Website link in English is: http://www.classofclassy.com and the Arabic version is http://www.classofclassy.com/ar

    Now, as for your suggestion I did try the site under incognito mode and what I got was really very interesting as the entire plugin behavior changed!

    Here are the scenarios that I face, Sorry for the lengthy post ahead…

    First here are the plugin settings for the English site:
    https://i.imgur.com/p6WDVIm.jpg
    https://i.imgur.com/8prb5Sx.jpg

    And the settings for the Arabic site:
    https://i.imgur.com/T0ZgnDA.jpg
    https://i.imgur.com/eBHRpJL.jpg

    Now, first notice is that if ‘Disable Menus Query Filter’ is unchecked the only menu visible is the switcher and all other menus disappear!, I have to check that option so all the menus appear normally.

    Second: From the screen shots, the plugin settings for languages on the Arabic site have the Arabic language highlighted as default while on the English site English does not have the same highlight… Not sure if that impacts any thing!

    (I linked one post only “Curly hair” between the English and Arabic versions of the site, just to test it first…)

    When I test the website in a normal browser window what happens is:

    On the English site when I click on the linked post “Curly Hair” what opens is the Arabic version of the post instead, while on the Arabic site when I click on the same post there it opens the Arabic version as it should. And trying to use the switcher to switch between the two languages does not work…

    When testing on incognito mode it works as intended, on English site the post opens the English version and on Arabic site the post opens the Arabic version and the switcher works fine to switch between the two languages, But… on the switcher,when switching between the posts, when on the Arabic version the drop-down menu for the switcher shows only the second language instead of listing both languages! (Screenshot to clarify):
    English site switcher: https://i.imgur.com/X5AuN7o.jpg
    Arabic site switcher: https://i.imgur.com/UO1yjMX.jpg

    Second scenario: There is an option in the plugin ‘Disable Session’ when i checked that option things changed…

    In normal browser window, with that option checked I can get the English post to open the English version just fine and the Arabic post to open the Arabic version just fine, and the switcher shows both language fine all the time, however I can switch from the English to Arabic but can’t switch from Arabic to English, and the switch while on the English version of the post always shows the Arabic as selected instead of the English as it should.

    On incognito mode though, with the ‘Disable Session’ option checked everything works perfect, the plugin works as intended, the switcher works as intended, no problems at all…

    One final side note that is minor to me is that when the plugin is active the menu order is always left to right while on the Arabic site it should be right to left… It is like as if the plugin overrides the menu order and set it to always left to right, that is the case across all scenarios in normal and incognito modes.

    And another thing is that the plugin section in the post where you enter the link to the second language remembers the changes you make on The Arabic site but always resets on the English site (it works fine still but it just resets the fields when you open the post for edit), screenshots to clarify:
    English site section: https://i.imgur.com/ZxrILpd.jpg
    Arabic site section: https://i.imgur.com/AyGWOL8.jpg
    English site section as it should be: https://i.imgur.com/RdzDDou.jpg (the field also odes not recognize the Arabic in the link but the link works fine still)

    I hope I provided enough clear details to help fixing the issue and again thanks a lot in advance for your support.

    Best Regards.

    • This reply was modified 4 months, 2 weeks ago by pop3d.
    • This reply was modified 4 months, 2 weeks ago by pop3d.
    • This reply was modified 4 months, 2 weeks ago by pop3d.
    Plugin Author rafasashi

    (@rafasashi)

    Hello pop3d,

    There might be more than one issue related to your scenario but we started with the one we detected first.

    The plugin uses cookies to store the current and default languages because they are needed as soon as possible to switch both site language and/or content (url).

    In your scenario there is a conflict because both sites share the same cookies since they are served under the same domain name.

    In the version 3.2.1 the cookie key differentiate the sites and therefore should fix this redirection issue.

    However the issue about the “Default Language” not appearing in one of the site settings might still be there.

    Could you please upgrade, test and let me know about the 2 issues reported?

    Have a nice day!

    Thread Starter pop3d

    (@pop3d)

    Hello Rafasashi,

    Thank you so much for your effort, I downloaded the upgraded version of the plugin and gave it a test run, and it works like charm, perfect, everything works as intended, that was a magnificent job you did there and I can’t thank you enough for this.

    I had to clear the browser’s cache and cookies first for the changes to take effect, but once done the plugin worked perfectly fine. Thank you.

    Now, I hope I’m not asking for too much, it is just this one more little thing to fix and this would be the perfect plugin all around.

    The Arabic version of the site should be aligned right (As Arabic language is a Right to Left language) but once the plugin is active on the site it force align the entire site to the left, both the menu and the posts and also the widgets are aligned left instead of right for the Arabic site. Screenshot to clarify:

    Arabic site with the plugin disabled: https://i.imgur.com/qSFdl2I.jpg
    Arabic site with the plugin enabled: https://i.imgur.com/qIQaKRT.jpg

    As you can see in the screenshots everything went left with the plugin enabled and the menu order changed to be left to right.

    If this can be fixed I’d be extremely grateful, and thanks again for your effort and for the awesome plugin.

    Best Regards.

    • This reply was modified 4 months, 2 weeks ago by pop3d.
    Plugin Author rafasashi

    (@rafasashi)

    Hello pop3d,

    Your theme uses the class “rtl” to change the alignment but the plugin was not setting the wp locale properly for Arabic.

    The version 3.2.2 should fix this issue for RTL languages.

    Could you please upgrade and let me know if it is working for you now?

    Kindly.

    Thread Starter pop3d

    (@pop3d)

    Hello Rafasashi,

    Thanks you very much for your magnificent effort, right now the plugin works perfectly as intended, and it is truly the best multi-language plugin out there, really much appreciated.

    I hope that the donated version of the plugin is also updated with these changes?, you’ve earned it. 🙂

    And again thanks a lot,
    Best Regards.

    • This reply was modified 4 months, 2 weeks ago by pop3d.
    Plugin Author rafasashi

    (@rafasashi)

    Hello pop3d,

    Thank you very much for your participation and your valuable feedbacks.

    The core features of the plugin will remain in the open source and therefore will be updated via wordpress.org

    The “Language Switcher Everywhere” premium plugin just unlock more post types and taxonomies for advance use. It should not be upgraded so often but if necessary we will push the source via our installer platform.

    For you it should not make any difference and you should be notified via the plugin panels like for the rest of the plugins.

    However if you detect any issues regarding our licensing and versioning solution for the premium feel free to contact me 😀

    Once again thank you for your feedbacks.
    Kindly

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.