s-ludwig / fuzzydate

Simple fuzzy date string generator
MIT License
1 stars 2 forks source link

Russian language oddities #1

Open georgy7 opened 7 years ago

georgy7 commented 7 years ago
Number English Russian
a minute ago минуту назад
2‒4, 22‒24, 32‒34, 42‒44, 52‒54 2 minutes ago 2 минуты назад
5‒20, 35‒40, 45‒50, 55‒59 5 minutes ago 5 минут назад
21, 31, 41, 51 21 minutes ago 21 минуту назад
an hour ago час назад
2‒4, 22‒24 2 hours ago 2 часа назад
5‒20 5 hours ago 5 часов назад
21 21 hours ago 21 час назад

I mean, there is a lot of languages in the world. I can not imagine, how to make the addition of a new language simple.

georgy7 commented 7 years ago

About other languages: https://www.drupal.org/docs/7/api/localization-api/formatting-numbers-datestimes-sizes-and-intervals-with-localization

georgy7 commented 7 years ago

In Russian this is the common rule for all numbers with nouns. If a number ends with 1, the noun is the same as singular, if a number ends with 2‒4 (except for 12‒14), the noun is like in genitive case of singular ("2 часа" sounds like "2 of an hour"), and in other cases, they are like genitive case in plural ("5 часов" sounds like "5 of hours").

georgy7 commented 7 years ago

In "минуту назад" and "час назад", "minute" and "hour" are in the accusative case.

Bolpat commented 7 years ago

This sounds very interesting; I've thought about that previously. Do you want it to be extendible by users or only a flexible interface for you? Do you really need "a minute ago" or would "1 minute ago" be good enough? I find it very inconsistent using numbers and articles mixed. If you use "a minute ago" it would be consistent to use "two minutes ago" instead of "2 minutes ago". I tend to using numbers always.

georgy7 commented 7 years ago

@Bolpat Extendable for all languages, of course. I am just peering. Don't need this library right now.

I find it very inconsistent using numbers and articles mixed.

I would prefer "a minute ago" and "2 minutes ago". It could be сustomizable, I think.

Bolpat commented 7 years ago

How many seconds ago feel "just now"? I suspect it differs with cultures.

georgy7 commented 7 years ago

I suppose, it depends more on a person then his/her country/culture/language. Well, I would set this "just-now-limit" to 20 seconds.