Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lode
Copy link

@lode lode commented Feb 17, 2019

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!

@da2x
Copy link
Collaborator

da2x commented Feb 26, 2019

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
Copy link
Contributor

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.

Copy link
Contributor

@brandl-muc brandl-muc left a 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.

@brandl-muc
Copy link
Contributor

I’ll need some time to think about the possible localization issues this may cause. Help in reviewing this would be quite welcome.

Can you elaborate on the possible issues? Are you afraid that some languages cannot be represented with the given solution?

@da2x
Copy link
Collaborator

da2x commented Apr 16, 2019

I really don’t know what the localization issues are, but I expect there to be many.

@brandl-muc
Copy link
Contributor

I guess you are referring to something like this: How To Tell Time In Russian
Although this page suggests that it would actually still work: 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?

@da2x
Copy link
Collaborator

da2x commented Apr 17, 2019

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).

@brandl-muc
Copy link
Contributor

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.
On the other hand halving seems natural, so halving an hour and then again halving that seems agnostic of the counting system.

But to actually make progress I only see three possibilities:

  • decline the PR
  • accept the proposed system and wait for someone to complain that their language cannot be represented (probably unlikely to happen)
  • go for the 48 individual strings given that halving the half should be a universal thing.
  • OK a 4th: use the original proposal of Fuzzy clock #6, maybe replacing quarter with fifteen for the sake of consistency.

We sure can wait some more but I doubt this will shed more light on the subject.

@brandl-muc
Copy link
Contributor

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:

  • Clock-time expressions in the colloquial language: some suggested universals
    They have an Euro-centric view which they admit. In the comments it is noted that Arabic may have thirds, however that seems like an additional option, as this blog teaches quarters and halves only.
    The article is based on a German master thesis on the subject. I could try to get a copy, however I doubt that it will reveal a lot more.
  • This Quora thread collected many different forms of telling the time, having full and half hours seems universal.
    Many languages have quarters as well, and those that don't seem to simply use something along "15 past" and "45 past" / "15 to".
    As an extreme, Cantonese uses pentaminutes, so it would be "3 past" and "15 past". Quarters might not stand out that much here but there is definitely a natural colloquial form to designate that time point.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants