GithubHelp home page GithubHelp logo

Comments (10)

MehdiK avatar MehdiK commented on August 17, 2024

@hazzik - could you please explain what you mean by this?

from humanizer.

hazzik avatar hazzik commented on August 17, 2024

Sorry for long being quiet a long time. I'll try to explain.

The idea was to bring that grammatical categories to the library to simplify localisation, Internationalisation and globalisation easier to languages with that categories.

As first example we could make a common mechanism to identify grammatical number category, and based on this rule select a correct resource key.

For English: 1 => singular; 2 => dual; 3 => plural, etc
For Russian: 1 => singular; 2,3,4=>paucal; 5 => plural.

Later I plan to implement localisation for Russian using that approach.

from humanizer.

mexx avatar mexx commented on August 17, 2024

From what I saw by now I think that GrammaticalNumber should be a local concept of each language specific formatter, as different languages do have different cases for it and it only depends on the number being formatted. So I would not introduce it as public concept of the API.

Even if the cases of GrammaticalCase and GrammaticalGender also differ from language to language, these concepts need to be public to control the output of ToWords and ToOrdinalWords as parameters to this methods.

from humanizer.

mexx avatar mexx commented on August 17, 2024

As mentioned in my previous comment I added GrammaticalCase and GrammaticalGender in #147.
GrammaticalGender is currently not used, but I'll be using it when implementing ToOrdinalWords in russian translation.

from humanizer.

thunsaker avatar thunsaker commented on August 17, 2024

Awesome! I'll be integrating these into my #188 Spanish ordinal translation as well.

from humanizer.

MehdiK avatar MehdiK commented on August 17, 2024

I think it's safe to close this now that #147 is in. You agree guys?!

from humanizer.

mexx avatar mexx commented on August 17, 2024

👍 from me.

from humanizer.

MehdiK avatar MehdiK commented on August 17, 2024

@mexx so how is the GrammaticalNumber going to fit into this (for ordinal localisations)?

from humanizer.

mexx avatar mexx commented on August 17, 2024

For ordinal localisations only case and gender is needed. Grammatical number is determined by the number being formatted.

from humanizer.

MehdiK avatar MehdiK commented on August 17, 2024

Thanks for the response. Closing this. This was a burden I had NO idea about and I'm glad it's sorted. Thanks a lot.

from humanizer.

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.