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

Conflicting replacements for some languages #36

Closed
florianeckerstorfer opened this issue Aug 24, 2014 · 3 comments
Closed

Conflicting replacements for some languages #36

florianeckerstorfer opened this issue Aug 24, 2014 · 3 comments
Labels

Comments

@florianeckerstorfer
Copy link
Member

I realised that there are some conflicting replacements in the Slugify class. I think these are specially the Esperanto characters, since the characters are also used in other languages. For example,

Slugify.php L:60

'ĉ' => 'c',

Slugify.php L:414

'ĉ' => 'cx',

Should we remove Esperanto or provide some switch for users to select which version they want?

@mac2000
Copy link
Contributor

mac2000 commented Aug 25, 2014

In my opinion, for not making breaking changes easiest way is to fix bug by removing duplicates from esperando since it is not often used

As about switch - I think that it will be better if we will have multidimensional array for different locales with fallback one, so switch is not needed. But there is problem in both cases, if I have Ukrainian locale and transliterating sentence with English words within it - what should happen?

So I personally think that decision about switches, locales etc should be delayed until it become really needed, for this moment it is only first case with duplicates, so seems not to be so big deal. Pretty of Slugify in its simplicity, and if you really really want you always can change default rules by providing your own for each letter you want

@mac2000
Copy link
Contributor

mac2000 commented Aug 25, 2014

Just added #37 pull request demonstrating how you can fit slugify behavior to your needs, hope this at least will help to immediately fix troubles

@florianeckerstorfer
Copy link
Member Author

The formulation of using a switch was a bit clumsy. What I mean is to move conflicting rules (currently I think it is only Esperanto) into a separate transliteration array. The switch would merge the two transliteration arrays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants