Giter Club home page Giter Club logo

Comments (7)

uyab avatar uyab commented on May 25, 2024

It was easy to implement, but I don't think this was common needs. Could you explain more why you need this?

from avatar.

 avatar commented on May 25, 2024

Yes, RTL languages get the initials in reverse order...

from avatar.

uyab avatar uyab commented on May 25, 2024

For "Andy Bar Cook" as a name and initial length was 2, which one do you expects as initials? BA or CB

from avatar.

 avatar commented on May 25, 2024

As for RTL languages "Cook" would be the first name, "Bar" the middle name and "Andy" the last name, therefore, to work similar to LTR languages, I would expect CB.

I would also appreciate if you would add the reverse functionality as a dynamic call, not just as a config flag, due to the fact that the code has to first determine whether the input string is RTL or LTR and then use (or not) the reverse mode.

Thanks again :)

from avatar.

uyab avatar uyab commented on May 25, 2024

Yes, I'm thinking the same about customizable InitialGenerator class. In the meantime, you can just generate your own initials, and pass the final string to avatar class :)

from avatar.

uyab avatar uyab commented on May 25, 2024

Hi @Mintzs, would you like to check master branch to see if current implementation can fulfill your needs?

from avatar.

 avatar commented on May 25, 2024

Great! This way I can extend the default generator class, check the string and manipulate it if necessary before calling the original make method (using parent::make).

*Of course, for my specific case I'd check the string's direction and if RTL would reverse the string prior to the parent make call.

from avatar.

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.