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

Extract slug generator to separate method #94

Closed
wants to merge 2 commits into from
Closed

Extract slug generator to separate method #94

wants to merge 2 commits into from

Conversation

enl
Copy link

@enl enl commented Feb 15, 2014

The main reason for changing this is that all standard php methods of transliaterationg are unstable (like iconv) or unusable for russian (Transliterator class). So that I managed to extract slug generation to separate method which can be redefined without need to copypaste.

In addition, I created Utils class with static function which applies traditional russian way of transliteration.

Added rules for russian transliteration
*/
protected function getTransliterator()
{
return function($string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This look kinda weird. Inception function in a method.

If you need to pass parameter, try call_user_func_array

Also it would be nice to keep inner compatibility of this package. Checkout this localeCallable in Translatable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that you don't need to return a closure to call it directly after.

Just name the method "transliterate" (or someting) and return this result.
Anyone will be able to replace it in its class anyway. See what I mean?

Otherwise, (and it was the case before already with iconv), but we need to put ext-intl (or ext-iconv) in the list of requires (or suggests) in composer.json IMHO.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see :)

@akovalyov akovalyov force-pushed the master branch 4 times, most recently from 6cb1e53 to 0a444f6 Compare May 27, 2015 13:24
@MAXakaWIZARD
Copy link
Contributor

@enl I think this issue has been fixed in #162

@enl enl closed this Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants