-
Notifications
You must be signed in to change notification settings - Fork 966
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
ToWords
should be localised
#15
Comments
For example:
So keys should be really customizable. |
Hmmm, you lost me there! You are right - this takes a flexible solution; but I am not sure what that is as I don't even know the requirements for it. So I guess you either have to teach me a bit of Russian or tackle this yourself ;) |
I've added some more explanations and I hope that this is now more clear and understandable |
Maybe have a provider that could, given a number, return the proper string that represents it. Would look like this:
Just an idea. |
Thanks for the nice idea @MaximRouiller I think the translation logic is so intertwined into the implementation and the variations on different locales are so diverse and different that any provider or localisation effort would require a re-implementation of the whole thing. That said it could be helpful for apps with globalization needs to have this implemented one way or another. |
What are we going to do if we do not have "Ordinalizer" for specific culture? |
There is an ongoing effort to add arabic I think different languages have different enough rules around |
But I see a lot of similarities. I mean |
Ah, sorry. Yeah, we could create something similar to Just like other methods, if the locale is not implemented, we'll just default to English. That will encourage more contribution to localisation :) |
Also I want to make |
Arabic support was added to |
I'm doing pt-BR and Portuguese also has a few particularities: As it happens in Russian, Portuguese's hundreds have their own names:
"100" changes depending if it is an exact number:
Numbers sometimes have plurals:
Numbers sometimes accepts two names:
Numbers sometimes are omitted:
They also sometimes have genders:
Since we still don't have a way of providing gender differences, I'll be doing it in male gender, because it is the predominant gender in portuguese language, meaning: if there are two words in a sentence, one male and one female, the male gender is used to describe them both at the same time. |
Take a look at my PR #151 for suggestions. Spanish has many similarities, |
@thunsaker thank you for the heads up, I used your ES commit to optimize some of my functions and also some of my tests. |
Thanks @akamud for your comment and @thunsaker for the response. @akamud - please checkout further discussions on #151. In #149 some changes were introduced which should be used as the foundation for There are also some works on the way with regards to grammatical gender, number and case, as per #74, which might change the way you're implementing your |
I think the gender is trickiest part as the same word can have different gender in different languages. |
Closing this now as there is proper infrastructure in place to deal with it (as of #149), and it's just a matter of adding more localisations, and many seem to be coming through! |
No description provided.
The text was updated successfully, but these errors were encountered: