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
546 stars 103 forks source link

Slug with dash (-) #1306

Closed vonsch76 closed 1 year ago

vonsch76 commented 1 year ago

@herrvigg seems that the slugs translation does not work when the category (maybe other as well) has a dash (-) character. So when I had "our-services" then no translation when changed to "services", then the translation went fine. The other slug translations with the dash just work fine.

herrvigg commented 1 year ago

Surprising, I don't think we have anything special where this character would be a problem.

@spleen1981 please could you take a look at this?

spleen1981 commented 1 year ago

Both terms and posts slugs are sanitized before saving with sanitize_title, which allows dashes (and it works based on my test). Also, uniqueness of candidate slug is tested per language, but a suffix should be automatically added in that case if test fails. Is your slug unique per language?

vonsch76 commented 1 year ago

I also thought weird, still here is the example.

Screenshot from 2023-04-02 15-45-33 Screenshot from 2023-04-02 15-46-15 Screenshot from 2023-04-02 15-46-42

while without the dash Screenshot from 2023-04-02 15-47-53 Screenshot from 2023-04-02 15-48-18 Screenshot from 2023-04-02 15-48-35

spleen1981 commented 1 year ago

something is wrong with attached images

vonsch76 commented 1 year ago

something is wrong with attached images

originally sent from email, edited here

spleen1981 commented 1 year ago

I'm confused, "our-services" slug (which is not a category slug but categories base slug) is working or not? It looks like is working and online.

vonsch76 commented 1 year ago

Our services - that is a slug from a category - does not work when it has the dash in it..When changed just to services it works fine. It does not translate into the equivalent with the dash, while translates without.

On Sun, 2 Apr 2023 at 17:54, Giovanni Cascione @.***> wrote:

I'm confused, "our-services" slug (which is not a category slug but categories base slug) is working or not? It looks like is working and online.

— Reply to this email directly, view it on GitHub https://github.com/qtranslate/qtranslate-xt/issues/1306#issuecomment-1493377927, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXKJAKLPS6GBPIQHNG6YK3W7GOLFANCNFSM6AAAAAAWPTDWZQ . You are receiving this because you authored the thread.Message ID: @.***>

spleen1981 commented 1 year ago

What is currently https://hajoznijo.hu/hu/our-services/, which I can see it's working? A separate page? What happens if instead of our-services you use test-services as the category slug?

vonsch76 commented 1 year ago

by surprise test-services also seem to work fine. Seems that I have the conflict elsewhere.

spleen1981 commented 1 year ago

No surprise, as said above, slug uniqueness is tested before saving, and you already seem to have a page with that slug. Category slug will also be used for items archive page, so it would be in conflict with existing page. To use that slug for the category, you should remove the existing page, set the slug for the category and use the resulting archive page to do the same job of current our-services page, maybe using templates to have the same result.

I think we can close here anyways.