Skip to content

Commit 6e5e34b

Browse files
committed
Fix bug with pluralization of Russian translations for numbers ending in 1
1 parent e4d139a commit 6e5e34b

4 files changed

Lines changed: 35 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [#134](https://github.com/radar/distance_of_time_in_words/pull/134): Add support for Dzongkha, the National language of Bhutan - [@KinWang-2013](https://github.com/KinWang-2013).
66
* [#135](https://github.com/radar/distance_of_time_in_words/pull/135): Add support for Ruby 2.7 and 3.2, removed support for ruby 2.4, 2.5, 2.6 and Rails 4 - [@KinWang-2013](https://github.com/KinWang-2013).
77
* [#136](https://github.com/radar/distance_of_time_in_words/pull/136): Add support for Rails 7 - [@KinWang-2013](https://github.com/KinWang-2013).
8+
* [#139](https://github.com/radar/distance_of_time_in_words/pull/139): Fix bug with pluralization of Russian translations for numbers ending in 1 - [bitberry-dev](https://github.com/bitberry-dev).
89
* Your contribution here.
910

1011
## 5.3.3 (2022/04/25)

lib/dotiw/locale/ru.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ ru:
3939
less_than_x: "меньше, чем %{distance}"
4040
dotiw_compact:
4141
seconds:
42-
one:
42+
one: "%{count}с"
4343
other: "%{count}с"
4444
minutes:
45-
one:
45+
one: "%{count}м"
4646
other: "%{count}м"
4747
hours:
48-
one:
48+
one: "%{count}ч"
4949
other: "%{count}ч"
5050
days:
51-
one:
51+
one: "%{count}д"
5252
other: "%{count}д"
5353
weeks:
54-
one:
54+
one: "%{count}н"
5555
other: "%{count}н"
5656
months:
57-
one: 1ме
57+
one: "%{count}ме"
5858
other: "%{count}ме"
5959
years:
6060
one: "%{count}г"
@@ -66,11 +66,11 @@ ru:
6666
two_words_connector: ""
6767
last_word_connector: ""
6868
about_x_years:
69-
one: ~1г
69+
one: "~%{count}г"
7070
any: "~%{count}г"
7171
over_x_years:
72-
one: ">"
72+
one: ">%{count}г"
7373
other: ">%{count}г"
7474
almost_x_years:
75-
one: ~1г
75+
one: "~%{count}г"
7676
any: "~%{count}г"

spec/lib/dotiw_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,18 @@
113113
context category do
114114
fixtures.each_pair do |k, v|
115115
it v do
116+
options = {
117+
locale: lang
118+
}
119+
120+
options[:compact] = true if category.split.include?('compact')
121+
116122
expect(
117123
distance_of_time_in_words(
118124
START_TIME,
119125
START_TIME + eval(k),
120126
true,
121-
locale: lang
127+
options
122128
)
123129
).to eq(v)
124130
end

spec/lib/i18n/ru.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,21 @@ seconds:
33
1.second: 1 секунда
44
minutes:
55
1.minute: 1 минута
6+
compact seconds:
7+
1.second:
8+
11.seconds: 11с
9+
21.seconds: 21с
10+
compact minutes:
11+
1.minute:
12+
11.minutes: 11м
13+
21.minutes: 21м
14+
compact hours:
15+
1.hour:
16+
11.hours: 11ч
17+
21.hours: 21ч
18+
compact days:
19+
1.day:
20+
compact years:
21+
1.year:
22+
11.years: 11г
23+
21.years: 21г

0 commit comments

Comments
 (0)