OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.23k stars 2.34k forks source link

Turkish Characters in URL Slug #16393

Closed fabrikamedya closed 1 day ago

fabrikamedya commented 3 days ago

Describe the bug

I am using OrchardCore in Turkish. In Turkish, there are characters such as ı, I, ş, Ş, ö, Ö, ü, Ü, ğ, Ğ, ç, and Ç. I am experiencing an issue where, when I use Turkish characters (ı) in titles, the URL slug is also created with Turkish characters.

Describe the bug

Orchard Core version

orchardcore-cms-linux:1.8.2

Add the version of the Orchard Core NuGet packages you use, or the commit hash if you can reproduce this with the source code.

To Reproduce

Steps to reproduce the behavior:

  1. Create new Page
  2. Add a Title, in Turkish Language, like: "Başlık" after click to publish
  3. Check the URL Slug
  4. See error

Expected behavior

When I create a title with Turkish characters, I want the URL slug to be generated with English characters as it normally should be.

Logs and screenshots

Screenshot 2024-07-02 at 10 49 23
github-actions[bot] commented 3 days ago

Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. A core team member will review your issue and get back to you.

If you like Orchard Core, please star our repo and join our community channels.

hishamco commented 3 days ago

This is because the SlugService removes the diacritics, have a look to this test

https://github.com/OrchardCMS/OrchardCore/blob/fd02d1167ead26829d1112c170bf4d66933b638c/test/OrchardCore.Tests/Tokens.Content/SlugServiceTests.cs#L62-L67

Piedone commented 2 days ago

Hisham, the issue here is that SlugService doesn't remove the Turkish diacritics.

hishamco commented 2 days ago

Maybe I am confused with the "I" symbol in the screenshot, I will try to reproduce the issue

hishamco commented 2 days ago

@fabrikamedya ignore my first comment

emrahtokalak commented 1 day ago

I wrote my own liquid filter for this problem. All it does is convert the character "i" to "i".

Screenshot 2024-07-04 at 09 42 54
fabrikamedya commented 1 day ago

I wrote my own liquid filter for this problem. All it does is convert the character "i" to "i".

Screenshot 2024-07-04 at 09 42 54

Great! Thank you.

hishamco commented 1 day ago

@emrahtokalak that's not enough, the fix should remove all Turkish diacritics

arkadiuszwojcik commented 1 day ago

Duplication of #4874 ?

emrahtokalak commented 1 day ago

There are special characters "ÇçğİiÖÖŞŞÜü" in Turkish. In addition to the existing SlugService, replacing the letter ı with i seems sufficient.

Screenshot 2024-07-04 at 12 37 45
Piedone commented 1 day ago

Yes, this is actually a duplicate of https://github.com/OrchardCMS/OrchardCore/issues/4874. Let's continue there.

hishamco commented 17 hours ago

Related to https://github.com/OrchardCoreContrib/OrchardCoreContrib/issues/11