-
Notifications
You must be signed in to change notification settings - Fork 34
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
Slow time with natural language #39
base: master
Are you sure you want to change the base?
Conversation
I’ll need some time to think about the possible localization issues this may cause. Help in reviewing this would be quite welcome. |
hour = 12; | ||
} | ||
|
||
// convert from 0-23 to 1-12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code duplication, would be better to create a function that does the 0-23 to 1-12 conversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, it would be nice to add tests though once #33 is finished.
Can you elaborate on the possible issues? Are you afraid that some languages cannot be represented with the given solution? |
I really don’t know what the localization issues are, but I expect there to be many. |
I guess you are referring to something like this: How To Tell Time In Russian I guess the only way to play safe would be to have a localizable string for all 48 combinations in the 12 hour system. Would that be a better solution? |
Danish and French use vigesimal numbers (base 20). I'm assuming they also more often round to 20 and 40 instead of quarters when telling time "naturally". It's regional stuff like that I'm unsure about. I was hoping to find a more comprehensible resource covering common time expression internationalization issues, but few cover natural language (at least with English translations). |
I guest most peoples today really use a decimal system. I didn't and don't know about the Danish, but the French really only have irregular names for several multiples of ten - but also only those greater than 60.The clock should therefore be no problem for them. But to actually make progress I only see three possibilities:
We sure can wait some more but I doubt this will shed more light on the subject. |
Trying to revive this one too. I'll try to argue for the 48 string approach. If it still doesn't sound like a good idea I would ask for declining this PR. There are a few resources on the topic:
This strongly suggests that the basic concept of displaying the slow time based on quarters is sound. However I don't think that the code as it stands does the trick since languages might decline numbers differently with their counterparts of "past" and "to". (Russian in fact does just that) Therefore, I would offer to adopt this to a 48 string system in case you would then accept it. |
Adds an option for slow time using natural language. This is roughly based on the idea of @Cj-Malone in #6.
I'm unsure about the locale changes with translations from format.js as I had some trouble building these translations in the .po files. Please let me know if this is not done in a correct way!