Opened 9 years ago

Closed 9 years ago

#2412 closed defect (fixed)

Not correct plural forms in "GPS Taces" page on National Languages

Reported by: Calibrator Owned by: tom@…
Priority: major Milestone:
Component: admin Version:
Keywords: Cc:

Description

English Page GPS Traces looks correct: 1 minute ago, 2 minutes ago, 6 minutes ago.
Russian Page not correct: 1 минуты назад, 2 минуты назад, 6 минуты назад.
In Russian must be 2 plural forms: 1 минута назад, 2 минуты назад, 6 минут назад.
Not impossible to edit Localised strings in 2 Russian Plural forms. I am not found this strings in http://translatewiki.net/wiki/Translating:OpenStreetMap now.

Change History (10)

comment:1 Changed 9 years ago by tom@…

  • Resolution set to invalid
  • Status changed from new to closed

That string is a standard rails message so has to be handled by changing the translation in the rails-i18n plugin. You can find that here:

http://github.com/svenfuchs/rails-i18n

and the Russian translation specifically is here:

http://github.com/svenfuchs/rails-i18n/commits/master/rails/locale/ru.yml

We update from those translations periodically, so if you submit changes there then they will then make their way to OpenStreetMap, and you'll be helping out other rails based sites as well.

comment:2 Changed 9 years ago by tom@…

  • Resolution invalid deleted
  • Status changed from closed to reopened

Actually, looking at the translations for Russian I think the data is already there, we just need a custom pluralizer for Russian. The keys for that message are:

less_than_x_minutes:

one: "меньше {{count}} минуты"
few: "меньше {{count}} минут"
many: "меньше {{count}} минут"
other: "меньше {{count}} минуты"

We will only be using "one" and "other" though. If you can let me know the rule that should be used decide which numbers map to each of those keys then I can add a custom pluralizer and make it work properly.

comment:3 Changed 9 years ago by tom@…

That quote should have been formatted as:

      less_than_x_minutes:
        one:   "меньше {{count}} минуты"
        few:   "меньше {{count}} минут"
        many:  "меньше {{count}} минут"
        other: "меньше {{count}} минуты"

comment:4 Changed 9 years ago by Calibrator

This code may still be useful for you and Ruby I18n community. You can learn how to create custom backends for I18n and how to provide support of “standalone” (as defined in Unicode CLDR) month names with I18n and Rails, and also how to add dead simple pluralization rules into your translation tables. This library also includes a module (Russian) with a set of helpers to provide simplistic pluralization and strftime for Russian language — in a way that is easier than using I18n methods.
Feel free to shoot an email to Yaroslav Markin (yaroslav@…)

comment:5 Changed 9 years ago by tom@…

What are you referring to exactly? I'd rather not have to add whole code modules for each language if I can avoid it, but if you could just answer my question then I can fix the pluralisation issue...

comment:6 Changed 9 years ago by Calibrator

For Russian:
1,11, 21, 31, ... 91,101, 201... etc:
{{count}} минуты
{{count}} минуту назад
{{count}} часа назад
{{count}} дня назад
{{count}} года назад

2-10, 12-20, 22-30,... 92-100 etc:
{{count}} минут
{{count}} минут назад
{{count}} часов назад
{{count}} дней назад
{{count}} лет назад

comment:7 Changed 9 years ago by Calibrator

For Russian: 1,11, 21, 31, ... 91,101, 201... etc:

меньше {{count}} минуты ( <1 min )

{{count}} минуту назад


{{count}} часа назад


{{count}} дня назад


{{count}} года назад

2-10, 12-20, 22-30,... 92-100 etc:

{{count}} минут

{{count}} минут назад

{{count}} часов назад

{{count}} дней назад

{{count}} лет назад

comment:8 Changed 9 years ago by Calibrator

sorry. Do Not look my previous messages. Tomorrow I will send more correct. Excuse me.

comment:9 Changed 9 years ago by Calibrator

This is CORRECT version for Russian (uffffff!) :)

1, 21, 31, ... 91, 101, 111, etc.
{{count}} минута назад - {{count}} minute(s) ago
около {{count}} часа назад - about {{count}}hour(s) ago
{{count}} день назад - {{count}} day(s) ago
{{count}} месяц назад - {{count}} month(s) ago
около {{count}} года назад - about {{count}} year(s) ago

2-4, 22-24, 32-34, ... etc.
{{count}} минуты назад - {{count}} minutes ago
около {{count}} часов назад - about {{count}}hours ago
{{count}} дня назад - {{count}} days ago
{{count}} месяца назад - {{count}} months ago
больше {{count}} лет назад - more {{count}} years ago


5-20, 25-30, 35-40, ... etc.
{{count}} минут назад - {{count}} minutes ago
около {{count}} часов назад - about {{count}}hours ago
{{count}} дней назад - {{count}} days ago
{{count}} месяцев назад - {{count}} months ago
больше {{count}} лет назад - more {{count}} years ago

comment:10 Changed 9 years ago by tomhughes

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [18436]) Add russian pluralization logic, based on description in the russion
plugin here:

http://github.com/yaroslav/russian/blob/master/lib/russian/backend/advanced.rb

Also simplify the other pluralizers by defaulting to :other when a
specific subkey is not found.

Closes #2412.

Note: See TracTickets for help on using tickets.