Git Product home page Git Product logo

Comments (5)

florianeckerstorfer avatar florianeckerstorfer commented on June 6, 2024 1

I have to say nay. I think this is too language specific, I guess it would complicate things too much for an edge case. This is tied really closely to the language used for the string, much more than the rest of the transliterations rules. In most systems there will be more than one languages used. At least every system which is in some other language than English will have English words and phrases.

For example, a German blog on music could have a title like Angus & Julia Stone haben ein neues Album veröffentlicht, which would become angus-und-julia-stone-haben-ein-neues-album-veroeffentlicht, which is wrong because their band name should be transliterated to angus-and-julia-stone. It gets even more complicated if the German title contains another ampersand, e.g. in "Angus & Julia Stone haben ein neues Album & Video veröffentlicht in which case the first & should become and and the second & should become und.

To be honest, I also don't want to maintain a list of translations, the transliterations are headache enough. Especially when I guess that there are probably languages with special cases with multiple words for and.

from slugify.

florianeckerstorfer avatar florianeckerstorfer commented on June 6, 2024

I guess the better approach would be to create a separate library with this as special purpose. You could than apply the ampersand translator and Slugify in sequence if you want to see this behaviour in your stem.

from slugify.

kafoso avatar kafoso commented on June 6, 2024

Very good points. 👍

Additional rules have to be taken into account. Italian is usually excellent for testing linguistic rules and exceptions.

Perhaps I'll look into creating such a library myself. 😄

from slugify.

florianeckerstorfer avatar florianeckerstorfer commented on June 6, 2024

If you do create a library drop me a line and I include a link in the readme, in case other users need something like this.

from slugify.

kafoso avatar kafoso commented on June 6, 2024

Sure thing.

from slugify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.