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

Bug in qtranxf_wp_head() #198

Closed
herrvigg opened this issue Jun 22, 2018 · 3 comments
Closed

Bug in qtranxf_wp_head() #198

herrvigg opened this issue Jun 22, 2018 · 3 comments
Labels
bug Something isn't working, reproducible core Core functionalities, including the admin section legacy issue Legacy issue imported from original repo

Comments

@herrvigg
Copy link
Collaborator

Issue by nb000
Wednesday Jul 15, 2015 at 14:33 GMT
Originally opened as qTranslate-Team/qtranslate-x#198


Hi there!
I am writing about version qTranslate-X 3.4.1.
In the function qtranxf_wp_head() where the meta tags are generated, you add the alternate language link tags. To this you call the qtranxf_convertURL(...) function.
As the last parameter is true, there could be URLs generated, which do not exists.

For example:
domain = example.com
active languages: hu, de, en
default language = hu
hide default language code from URL is set to true
On the URL http://example.com/de/somepageslug the following links are generated:

<link hreflang="hu" href="http://example.com/hu/somepageslug" rel="alternate" />
<link hreflang="de" href="http://example.com/de/somepageslug" rel="alternate" />
<link hreflang="en" href="http://example.com/en/somepageslug" rel="alternate" />
<link hreflang="x-default" href="http://example.com/sompageslug" rel="alternate" />

Here the first URL is invalid.
I think, the function should be called without the last parameter.

@herrvigg herrvigg added legacy issue Legacy issue imported from original repo need info The submitter must provide more info labels Jun 22, 2018
@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Wednesday Jul 15, 2015 at 14:42 GMT


It is by design and is ok with google. This url must switch the language to hu even for google robots, which do not use cookies. This document may help: https://qtranslatexteam.wordpress.com/2015/02/26/browser-redirection-based-on-language/.

I am closing this issue for now, we can still write to closed issue and can re-open it if needed.

@herrvigg
Copy link
Collaborator Author

Comment by nb000
Thursday Jul 16, 2015 at 05:55 GMT


Answer is correct, and accepted.
Nice writing, but the linked page misses a piece of information:
the browser language based redirection can also be turned off at qTranslate-X settings.

herrvigg added a commit that referenced this issue May 31, 2020
Only if the language is detected by the browser, enforce the
language shown to make the default URL deterministic for SEO.

Otherwise, allow the option "Hide URL language information
for default language".

Note the "x-default" item is not concerned by these changes,
this link always uses the default URL with no override.
@herrvigg herrvigg added bug Something isn't working, reproducible core Core functionalities, including the admin section and removed need info The submitter must provide more info labels May 31, 2020
@herrvigg
Copy link
Collaborator Author

@nb000 this was a very hold issue, but a fix is now released in qTranslate-XT 3.9.0 when the browser detection is disabled!

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 legacy issue Legacy issue imported from original repo
Projects
None yet
Development

No branches or pull requests

1 participant