hustcc / timeago

:hourglass: Simple library used to format datetime with `*** time ago` statement. eg: "3 hours ago".
http://timeago.org
MIT License
224 stars 37 forks source link

added `sk` locale #39

Closed jenca-adam closed 2 years ago

laurentmmeyer commented 2 years ago

Hello there,

Thanks a lot for your work!

After reviewing your code, I cannot understand where this snippet is tested nor how it works, can you explain it in english? I would be really interested!

if y == 1 and time < 5:
    try:
        return base[row][y + 1]
    except IndexError:
        pass

Are you sure it is not time>5?

Could you have a look at slovakian-reviewed? (https://github.com/hustcc/timeago/tree/slovakian-reviewed)

jenca-adam commented 2 years ago

It's because in Slovak, numbers 2-4 are handled in a different way. For example, you have: "o päť minút"(in five minutes) but "o štyri minúty"(in four minutes) Basically, using "o" preposition, after 2-4 follows subject in nominative, but after 5-∞ follows subject in accusative. This does not apply with "pred"(there is alway instrumental [or accusative, but not when talking about time] ).

I know it seems rather strange to you, but it is like that - Slovak changes endings of words instead of changing the preposition, and some prepositions can be associated with more than one grammatical case.