Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong URL after language switch when using custom language #1035

Closed
DiegoAceve opened this issue Jun 4, 2021 · 5 comments
Closed

wrong URL after language switch when using custom language #1035

DiegoAceve opened this issue Jun 4, 2021 · 5 comments
Labels
bug Something isn't working, reproducible core Core functionalities, including the admin section

Comments

@DiegoAceve
Copy link

Hi,

I have added a new language (Papiamento) and used 3 letter code "pap" when creating it. After adding the language switcher menu and choosing this language links are now: https://website.com/papp/page/ instead of: https://website.com/pap/page/

All other languages are working fine, appreciate if someone knows how to fix this.

@herrvigg
Copy link
Collaborator

herrvigg commented Jun 4, 2021

I've tried on a test website and it works as expected, the 3-letter language code is handled correctly in the menu.
I don't have any URL with page literally but it works with all the pages I have.
Do you have other plugins enabled? qtranslate-slug? Also check if you have some specific URL rewrites.

@herrvigg
Copy link
Collaborator

herrvigg commented Jun 4, 2021

Oh wait, I see the problem with one menu... just one. How strange. I'll check this.

@herrvigg herrvigg added the core Core functionalities, including the admin section label Jun 4, 2021
@MK-RD
Copy link

MK-RD commented Jun 5, 2021

QTX 3.10.0

[ qtranslate_core.php ][ qtranxf_url_del_language() ]

...

#! $urlinfo['wp-path'] = substr($urlinfo['wp-path'], 3);
$urlinfo['wp-path'] = substr($urlinfo['wp-path'], strlen($match[1]) + 1);

...

@herrvigg herrvigg added the bug Something isn't working, reproducible label Jun 5, 2021
@herrvigg
Copy link
Collaborator

herrvigg commented Jun 5, 2021

@MK-RD good catch!
@DiegoAceve Fixed in master.

This didn't only impact the language switcher menu but possibly all menus with a 3-letters language code.

Still something weird as some menus are sent to qtranxf_convertURL with the language prefix and others not, while they all come from the same kind of pages. That explains why some menus were still correct, but I don't know the reason yet. Anyway that's a different question and the fix here should solve the current issues.

@herrvigg
Copy link
Collaborator

Released in 3.11.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, reproducible core Core functionalities, including the admin section
Projects
None yet
Development

No branches or pull requests

3 participants