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

The letters ö and ü in Turkish are problematic. #359

Closed
mksglu opened this Issue May 2, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@mksglu
Copy link

mksglu commented May 2, 2017

ENG:

In Turkish, the letter "ö" appears as "oe" and the letter "ü" appears as "ue". This is wrong.

To fix this: Update the file sluggable.php on line 47.

 'method' => function( $string, $sep  ) {

       return strtolower(str_replace(['ü', 'Ü', 'ö', 'Ö',' '], ['u', 'u', 'o', 'o','-'], $string));
     },

Turkish:

Türkçe'de, "ö" harfi "oe" ve "ü" harfi "ue" şeklinde gözükmektedir. Bu hatalıdır.

Bunu düzeltmek için: sluggable.php dosyası içerisine 47. satırda güncelleme yapalım.

 'method' => function( $string, $sep  ) {

       return strtolower(str_replace(['ü', 'Ü', 'ö', 'Ö',' '], ['u', 'u', 'o', 'o','-'], $string));
     },
@cviebrock

This comment has been minimized.

Copy link
Owner

cviebrock commented May 2, 2017

You should really raise this issue with cocur/slugify since that's the underlying engine that handles slug generation.

That said, it looks like it should be slugging those characters correctly, based on this ruleset: https://github.com/cocur/slugify/blob/master/Resources/rules/turkish.json

I think what you should be doing is adding the following in your model:

public function customizeSlugEngine(Slugify $engine, $attribute)
{
    return $engine->activateRuleset('turkish');
}
@mksglu

This comment has been minimized.

Copy link
Author

mksglu commented May 2, 2017

Great! The method worked. Thank you so much dude.

@cviebrock cviebrock closed this May 17, 2017

Repository owner locked and limited conversation to collaborators May 17, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.