qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
545 stars 103 forks source link

[Slug translation module] hreflang has wrong value of Locale at front-end #1359

Closed FLAME007R closed 9 months ago

FLAME007R commented 11 months ago

When Slugs active and "Locale at front-end" have value in Language Editor, hreflang is set "Language Code" and ignore "Locale at front-end". When Slugs deactivated hreflang is set from value of "Locale at front-end". Some small bug.

Steps to reproduce the behavior:

  1. Go to page wp-admin/options-general.php?page=qtranslate-xt&edit=ua
  2. Edit value 'Locale at front-end' to "uk"
  3. Click Save
  4. Go to page wp-admin/options-general.php?page=qtranslate-xt#integration
  5. Slugs translation (activate / deactivate)
  6. See in code of page (<link hreflang="uk" if deactivated Slugs, <link hreflang="ua" if activated Slugs )

Expected behavior On all states of Slugs, hreflang have value "Locale at front-end" if is set.

qTranslate-XT  3.15.2

Thanks =)

spleen1981 commented 11 months ago

Can you test the slug_fixes branch?

FLAME007R commented 11 months ago

Can you test the slug_fixes branch?

Hello. Im replace strings in slugs.php. Same issue.

Slugs on. hreflang="ua" href=http://localhost/faq/ rel="alternate" hreflang="en" href=http://localhost/en/faq/ rel="alternate"

Slugs off. hreflang="uk" href=http://localhost/faq/ rel="alternate" hreflang="en" href=http://localhost/en/faq/ rel="alternate"

I have two same langs but with different base codes in qtranslate, after qtranslate -x: uk |   | uk | Українська | -not active ua |   | uk | УКР - this active

Any way, i have server to test, original site fully replaced to uk lang originaly in database and files. ... New bug incomming, slugs and incorrect url from the fourth level forward to blog without controlled url parse with redirect to error 404. Temporary Disabled blog.

spleen1981 commented 11 months ago

I just checked and it's working on my test environment: image That xyz is the "Locale at front-end" set up for the primary language. Slugs module is now using exactly the same function as QTX to define hreflang, so I don't see how the output can be same as before. Maybe you need to flush some cache or something. Also I suggest to avoid replacing strings in the source, just checkout to that branch (or replace the entire plugin content folder with the zip file of that branch, if you are not familiar with git).

The rest of the comment is quite unclear. Make sure you are testing the branch as it is, then if new bug is there please provide more detail.

FLAME007R commented 11 months ago

Im re save lang settings, clear cache. It work fine. Thanks. UP. Another problem with incorrect redirection for absent page to blog and ignoring 404 page are gone too. =) All work perfect.

spleen1981 commented 11 months ago

Reopening until #1363 is merged to master