aerogel-core 1.3.0 → 1.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/aerogel-core.gemspec +8 -2
- data/app/helpers/assets.rb +22 -8
- data/app/helpers/core.rb +82 -0
- data/app/helpers/i18n.rb +11 -0
- data/app/helpers/icon.rb +12 -0
- data/app/helpers/render.rb +89 -17
- data/app/helpers/tags.rb +18 -3
- data/app/routes/aerogel.rb +30 -0
- data/app/routes/core.rb +16 -1
- data/app/routes/i18n.rb +14 -0
- data/config/application.conf +8 -0
- data/config/development/aerogel.conf +9 -0
- data/config/production/aerogel.conf +10 -0
- data/lib/aerogel/core/application.rb +3 -0
- data/lib/aerogel/core/assets.rb +24 -0
- data/lib/aerogel/core/cache.rb +72 -0
- data/lib/aerogel/core/config.rb +10 -2
- data/lib/aerogel/core/core.rb +55 -10
- data/lib/aerogel/core/core_ext/array.rb +38 -0
- data/lib/aerogel/core/core_ext/hash.rb +48 -0
- data/lib/aerogel/core/db.rb +28 -8
- data/lib/aerogel/core/db/model.rb +52 -4
- data/lib/aerogel/core/errors.rb +23 -1
- data/lib/aerogel/core/helpers.rb +1 -1
- data/lib/aerogel/core/i18n.rb +134 -0
- data/lib/aerogel/core/i18n/number_helper.rb +126 -0
- data/lib/aerogel/core/reloader.rb +49 -5
- data/lib/aerogel/core/routes.rb +5 -3
- data/lib/aerogel/core/routes/namespace.rb +1 -1
- data/lib/aerogel/core/version.rb +3 -1
- data/locales/core/en.yml +17 -0
- data/locales/core/ru.yml +17 -0
- data/locales/db/en.yml +25 -0
- data/locales/db/ru.yml +24 -0
- data/locales/i18n-defaults/en.yml +211 -0
- data/locales/i18n-defaults/ru.yml +257 -0
- data/rake/console.rake +8 -0
- data/views/layouts/application.html.erb +1 -1
- data/views/lorem.html.erb +48 -0
- metadata +91 -3
- data/app/routes/static.rb +0 -7
data/locales/core/ru.yml
ADDED
data/locales/db/en.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
en:
|
2
|
+
aerogel:
|
3
|
+
db:
|
4
|
+
errors:
|
5
|
+
failed_to_save:
|
6
|
+
"Failed to save %{name}: %{errors}"
|
7
|
+
|
8
|
+
errors: &errors
|
9
|
+
format: '%{attribute} %{message}'
|
10
|
+
messages:
|
11
|
+
invalid_format: has invalid format
|
12
|
+
unique: must be unique
|
13
|
+
validations:
|
14
|
+
message: There was validation errors on %{document}
|
15
|
+
summary: "Errors:\n %{errors}"
|
16
|
+
resolution: Check the instances for this model looking for missing fields or wrong values.
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
activemodel:
|
21
|
+
errors:
|
22
|
+
<<: *errors
|
23
|
+
mongoid:
|
24
|
+
errors:
|
25
|
+
<<: *errors
|
data/locales/db/ru.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
ru:
|
2
|
+
aerogel:
|
3
|
+
db:
|
4
|
+
errors:
|
5
|
+
failed_to_save:
|
6
|
+
"Не удалось сохранить объект %{name}: %{errors}"
|
7
|
+
|
8
|
+
errors: &errors
|
9
|
+
format: '%{attribute} %{message}'
|
10
|
+
messages:
|
11
|
+
invalid_format: 'имеет неправильный формат'
|
12
|
+
unique: 'должен быть уникальным'
|
13
|
+
validations:
|
14
|
+
message: Были обнаружены ошибки валидации для %{document}
|
15
|
+
summary: "Ошибки:\n %{errors}"
|
16
|
+
resolution: "Проверьте данные объекта, обращая внимание на незаполненные поля и неправильные значения."
|
17
|
+
|
18
|
+
|
19
|
+
activemodel:
|
20
|
+
errors:
|
21
|
+
<<: *errors
|
22
|
+
mongoid:
|
23
|
+
errors:
|
24
|
+
<<: *errors
|
@@ -0,0 +1,211 @@
|
|
1
|
+
en:
|
2
|
+
date:
|
3
|
+
abbr_day_names:
|
4
|
+
- Sun
|
5
|
+
- Mon
|
6
|
+
- Tue
|
7
|
+
- Wed
|
8
|
+
- Thu
|
9
|
+
- Fri
|
10
|
+
- Sat
|
11
|
+
abbr_month_names:
|
12
|
+
-
|
13
|
+
- Jan
|
14
|
+
- Feb
|
15
|
+
- Mar
|
16
|
+
- Apr
|
17
|
+
- May
|
18
|
+
- Jun
|
19
|
+
- Jul
|
20
|
+
- Aug
|
21
|
+
- Sep
|
22
|
+
- Oct
|
23
|
+
- Nov
|
24
|
+
- Dec
|
25
|
+
day_names:
|
26
|
+
- Sunday
|
27
|
+
- Monday
|
28
|
+
- Tuesday
|
29
|
+
- Wednesday
|
30
|
+
- Thursday
|
31
|
+
- Friday
|
32
|
+
- Saturday
|
33
|
+
formats:
|
34
|
+
default: ! '%Y-%m-%d'
|
35
|
+
long: ! '%B %d, %Y'
|
36
|
+
short: ! '%b %d'
|
37
|
+
month_names:
|
38
|
+
-
|
39
|
+
- January
|
40
|
+
- February
|
41
|
+
- March
|
42
|
+
- April
|
43
|
+
- May
|
44
|
+
- June
|
45
|
+
- July
|
46
|
+
- August
|
47
|
+
- September
|
48
|
+
- October
|
49
|
+
- November
|
50
|
+
- December
|
51
|
+
order:
|
52
|
+
- :year
|
53
|
+
- :month
|
54
|
+
- :day
|
55
|
+
datetime:
|
56
|
+
distance_in_words:
|
57
|
+
about_x_hours:
|
58
|
+
one: about 1 hour
|
59
|
+
other: about %{count} hours
|
60
|
+
about_x_months:
|
61
|
+
one: about 1 month
|
62
|
+
other: about %{count} months
|
63
|
+
about_x_years:
|
64
|
+
one: about 1 year
|
65
|
+
other: about %{count} years
|
66
|
+
almost_x_years:
|
67
|
+
one: almost 1 year
|
68
|
+
other: almost %{count} years
|
69
|
+
half_a_minute: half a minute
|
70
|
+
less_than_x_minutes:
|
71
|
+
one: less than a minute
|
72
|
+
other: less than %{count} minutes
|
73
|
+
less_than_x_seconds:
|
74
|
+
one: less than 1 second
|
75
|
+
other: less than %{count} seconds
|
76
|
+
over_x_years:
|
77
|
+
one: over 1 year
|
78
|
+
other: over %{count} years
|
79
|
+
x_days:
|
80
|
+
one: 1 day
|
81
|
+
other: ! '%{count} days'
|
82
|
+
x_minutes:
|
83
|
+
one: 1 minute
|
84
|
+
other: ! '%{count} minutes'
|
85
|
+
x_months:
|
86
|
+
one: 1 month
|
87
|
+
other: ! '%{count} months'
|
88
|
+
x_seconds:
|
89
|
+
one: 1 second
|
90
|
+
other: ! '%{count} seconds'
|
91
|
+
prompts:
|
92
|
+
day: Day
|
93
|
+
hour: Hour
|
94
|
+
minute: Minute
|
95
|
+
month: Month
|
96
|
+
second: Seconds
|
97
|
+
year: Year
|
98
|
+
errors: &errors
|
99
|
+
format: ! '%{attribute} %{message}'
|
100
|
+
messages:
|
101
|
+
accepted: must be accepted
|
102
|
+
blank: can't be blank
|
103
|
+
present: must be blank
|
104
|
+
confirmation: ! "doesn't match %{attribute}"
|
105
|
+
empty: can't be empty
|
106
|
+
equal_to: must be equal to %{count}
|
107
|
+
even: must be even
|
108
|
+
exclusion: is reserved
|
109
|
+
greater_than: must be greater than %{count}
|
110
|
+
greater_than_or_equal_to: must be greater than or equal to %{count}
|
111
|
+
inclusion: is not included in the list
|
112
|
+
invalid: is invalid
|
113
|
+
less_than: must be less than %{count}
|
114
|
+
less_than_or_equal_to: must be less than or equal to %{count}
|
115
|
+
not_a_number: is not a number
|
116
|
+
not_an_integer: must be an integer
|
117
|
+
odd: must be odd
|
118
|
+
record_invalid: ! 'Validation failed: %{errors}'
|
119
|
+
restrict_dependent_destroy:
|
120
|
+
one: "Cannot delete record because a dependent %{record} exists"
|
121
|
+
many: "Cannot delete record because dependent %{record} exist"
|
122
|
+
taken: has already been taken
|
123
|
+
too_long:
|
124
|
+
one: is too long (maximum is 1 character)
|
125
|
+
other: is too long (maximum is %{count} characters)
|
126
|
+
too_short:
|
127
|
+
one: is too short (minimum is 1 character)
|
128
|
+
other: is too short (minimum is %{count} characters)
|
129
|
+
wrong_length:
|
130
|
+
one: is the wrong length (should be 1 character)
|
131
|
+
other: is the wrong length (should be %{count} characters)
|
132
|
+
other_than: "must be other than %{count}"
|
133
|
+
template:
|
134
|
+
body: ! 'There were problems with the following fields:'
|
135
|
+
header:
|
136
|
+
one: 1 error prohibited this %{model} from being saved
|
137
|
+
other: ! '%{count} errors prohibited this %{model} from being saved'
|
138
|
+
helpers:
|
139
|
+
select:
|
140
|
+
prompt: Please select
|
141
|
+
submit:
|
142
|
+
create: Create %{model}
|
143
|
+
submit: Save %{model}
|
144
|
+
update: Update %{model}
|
145
|
+
number:
|
146
|
+
currency:
|
147
|
+
format:
|
148
|
+
delimiter: ! ','
|
149
|
+
format: ! '%u%n'
|
150
|
+
precision: 2
|
151
|
+
separator: .
|
152
|
+
significant: false
|
153
|
+
strip_insignificant_zeros: false
|
154
|
+
unit: $
|
155
|
+
format:
|
156
|
+
delimiter: ! ','
|
157
|
+
precision: 3
|
158
|
+
separator: .
|
159
|
+
significant: false
|
160
|
+
strip_insignificant_zeros: false
|
161
|
+
human:
|
162
|
+
decimal_units:
|
163
|
+
format: ! '%n %u'
|
164
|
+
units:
|
165
|
+
billion: Billion
|
166
|
+
million: Million
|
167
|
+
quadrillion: Quadrillion
|
168
|
+
thousand: Thousand
|
169
|
+
trillion: Trillion
|
170
|
+
unit: ''
|
171
|
+
format:
|
172
|
+
delimiter: ''
|
173
|
+
precision: 3
|
174
|
+
significant: true
|
175
|
+
strip_insignificant_zeros: true
|
176
|
+
storage_units:
|
177
|
+
format: ! '%n %u'
|
178
|
+
units:
|
179
|
+
byte:
|
180
|
+
one: Byte
|
181
|
+
other: Bytes
|
182
|
+
gb: GB
|
183
|
+
kb: KB
|
184
|
+
mb: MB
|
185
|
+
tb: TB
|
186
|
+
percentage:
|
187
|
+
format:
|
188
|
+
delimiter: ''
|
189
|
+
format: "%n%"
|
190
|
+
precision:
|
191
|
+
format:
|
192
|
+
delimiter: ''
|
193
|
+
support:
|
194
|
+
array:
|
195
|
+
last_word_connector: ! ', and '
|
196
|
+
two_words_connector: ! ' and '
|
197
|
+
words_connector: ! ', '
|
198
|
+
time:
|
199
|
+
am: am
|
200
|
+
formats:
|
201
|
+
default: ! '%a, %d %b %Y %H:%M:%S %z'
|
202
|
+
long: ! '%B %d, %Y %H:%M'
|
203
|
+
short: ! '%d %b %H:%M'
|
204
|
+
pm: pm
|
205
|
+
# remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository
|
206
|
+
activemodel:
|
207
|
+
errors:
|
208
|
+
<<: *errors
|
209
|
+
activerecord:
|
210
|
+
errors:
|
211
|
+
<<: *errors
|
@@ -0,0 +1,257 @@
|
|
1
|
+
ru:
|
2
|
+
date:
|
3
|
+
abbr_day_names:
|
4
|
+
- Вс
|
5
|
+
- Пн
|
6
|
+
- Вт
|
7
|
+
- Ср
|
8
|
+
- Чт
|
9
|
+
- Пт
|
10
|
+
- Сб
|
11
|
+
abbr_month_names:
|
12
|
+
-
|
13
|
+
- янв.
|
14
|
+
- февр.
|
15
|
+
- марта
|
16
|
+
- апр.
|
17
|
+
- мая
|
18
|
+
- июня
|
19
|
+
- июля
|
20
|
+
- авг.
|
21
|
+
- сент.
|
22
|
+
- окт.
|
23
|
+
- нояб.
|
24
|
+
- дек.
|
25
|
+
day_names:
|
26
|
+
- воскресенье
|
27
|
+
- понедельник
|
28
|
+
- вторник
|
29
|
+
- среда
|
30
|
+
- четверг
|
31
|
+
- пятница
|
32
|
+
- суббота
|
33
|
+
formats:
|
34
|
+
default: ! '%d.%m.%Y'
|
35
|
+
long: ! '%-d %B %Y'
|
36
|
+
short: ! '%-d %b'
|
37
|
+
month_names:
|
38
|
+
-
|
39
|
+
- января
|
40
|
+
- февраля
|
41
|
+
- марта
|
42
|
+
- апреля
|
43
|
+
- мая
|
44
|
+
- июня
|
45
|
+
- июля
|
46
|
+
- августа
|
47
|
+
- сентября
|
48
|
+
- октября
|
49
|
+
- ноября
|
50
|
+
- декабря
|
51
|
+
order:
|
52
|
+
- :day
|
53
|
+
- :month
|
54
|
+
- :year
|
55
|
+
datetime:
|
56
|
+
distance_in_words:
|
57
|
+
about_x_hours:
|
58
|
+
few: около %{count} часов
|
59
|
+
many: около %{count} часов
|
60
|
+
one: около %{count} часа
|
61
|
+
other: около %{count} часа
|
62
|
+
about_x_months:
|
63
|
+
few: около %{count} месяцев
|
64
|
+
many: около %{count} месяцев
|
65
|
+
one: около %{count} месяца
|
66
|
+
other: около %{count} месяца
|
67
|
+
about_x_years:
|
68
|
+
few: около %{count} лет
|
69
|
+
many: около %{count} лет
|
70
|
+
one: около %{count} года
|
71
|
+
other: около %{count} лет
|
72
|
+
almost_x_years:
|
73
|
+
one: почти 1 год
|
74
|
+
few: почти %{count} года
|
75
|
+
many: почти %{count} лет
|
76
|
+
other: почти %{count} лет
|
77
|
+
half_a_minute: меньше минуты
|
78
|
+
less_than_x_minutes:
|
79
|
+
few: меньше %{count} минут
|
80
|
+
many: меньше %{count} минут
|
81
|
+
one: меньше %{count} минуты
|
82
|
+
other: меньше %{count} минуты
|
83
|
+
less_than_x_seconds:
|
84
|
+
few: меньше %{count} секунд
|
85
|
+
many: меньше %{count} секунд
|
86
|
+
one: меньше %{count} секунды
|
87
|
+
other: меньше %{count} секунды
|
88
|
+
over_x_years:
|
89
|
+
few: больше %{count} лет
|
90
|
+
many: больше %{count} лет
|
91
|
+
one: больше %{count} года
|
92
|
+
other: больше %{count} лет
|
93
|
+
x_days:
|
94
|
+
few: ! '%{count} дня'
|
95
|
+
many: ! '%{count} дней'
|
96
|
+
one: ! '%{count} день'
|
97
|
+
other: ! '%{count} дня'
|
98
|
+
x_minutes:
|
99
|
+
few: ! '%{count} минуты'
|
100
|
+
many: ! '%{count} минут'
|
101
|
+
one: ! '%{count} минуту'
|
102
|
+
other: ! '%{count} минуты'
|
103
|
+
x_months:
|
104
|
+
few: ! '%{count} месяца'
|
105
|
+
many: ! '%{count} месяцев'
|
106
|
+
one: ! '%{count} месяц'
|
107
|
+
other: ! '%{count} месяца'
|
108
|
+
x_seconds:
|
109
|
+
few: ! '%{count} секунды'
|
110
|
+
many: ! '%{count} секунд'
|
111
|
+
one: ! '%{count} секундy'
|
112
|
+
other: ! '%{count} секунды'
|
113
|
+
prompts:
|
114
|
+
day: День
|
115
|
+
hour: Часов
|
116
|
+
minute: Минут
|
117
|
+
month: Месяц
|
118
|
+
second: Секунд
|
119
|
+
year: Год
|
120
|
+
errors: &errors
|
121
|
+
format: ! '%{attribute} %{message}'
|
122
|
+
messages:
|
123
|
+
accepted: нужно подтвердить
|
124
|
+
blank: не может быть пустым
|
125
|
+
confirmation: 'не совпадает со значением поля %{attribute}'
|
126
|
+
empty: не может быть пустым
|
127
|
+
equal_to: может иметь лишь значение, равное %{count}
|
128
|
+
even: может иметь лишь нечетное значение
|
129
|
+
exclusion: имеет зарезервированное значение
|
130
|
+
greater_than: может иметь значение большее %{count}
|
131
|
+
greater_than_or_equal_to: может иметь значение большее или равное %{count}
|
132
|
+
inclusion: имеет непредусмотренное значение
|
133
|
+
invalid: имеет неверное значение
|
134
|
+
less_than: может иметь значение меньшее чем %{count}
|
135
|
+
less_than_or_equal_to: может иметь значение меньшее или равное %{count}
|
136
|
+
not_a_number: не является числом
|
137
|
+
not_an_integer: не является целым числом
|
138
|
+
odd: может иметь лишь четное значение
|
139
|
+
record_invalid: ! 'Возникли ошибки: %{errors}'
|
140
|
+
taken: уже существует
|
141
|
+
too_long:
|
142
|
+
few: слишком большой длины (не может быть больше чем %{count} символа)
|
143
|
+
many: слишком большой длины (не может быть больше чем %{count} символов)
|
144
|
+
one: слишком большой длины (не может быть больше чем %{count} символ)
|
145
|
+
other: слишком большой длины (не может быть больше чем %{count} символа)
|
146
|
+
too_short:
|
147
|
+
few: недостаточной длины (не может быть меньше %{count} символов)
|
148
|
+
many: недостаточной длины (не может быть меньше %{count} символов)
|
149
|
+
one: недостаточной длины (не может быть меньше %{count} символа)
|
150
|
+
other: недостаточной длины (не может быть меньше %{count} символа)
|
151
|
+
wrong_length:
|
152
|
+
few: неверной длины (может быть длиной ровно %{count} символа)
|
153
|
+
many: неверной длины (может быть длиной ровно %{count} символов)
|
154
|
+
one: неверной длины (может быть длиной ровно %{count} символ)
|
155
|
+
other: неверной длины (может быть длиной ровно %{count} символа)
|
156
|
+
template:
|
157
|
+
body: ! 'Проблемы возникли со следующими полями:'
|
158
|
+
header:
|
159
|
+
few: ! '%{model}: сохранение не удалось из-за %{count} ошибок'
|
160
|
+
many: ! '%{model}: сохранение не удалось из-за %{count} ошибок'
|
161
|
+
one: ! '%{model}: сохранение не удалось из-за %{count} ошибки'
|
162
|
+
other: ! '%{model}: сохранение не удалось из-за %{count} ошибки'
|
163
|
+
helpers:
|
164
|
+
select:
|
165
|
+
prompt: ! 'Выберите: '
|
166
|
+
submit:
|
167
|
+
create: Создать %{model}
|
168
|
+
submit: Сохранить %{model}
|
169
|
+
update: Сохранить %{model}
|
170
|
+
number:
|
171
|
+
currency:
|
172
|
+
format:
|
173
|
+
delimiter: ! ' '
|
174
|
+
format: ! '%n %u'
|
175
|
+
precision: 2
|
176
|
+
separator: ','
|
177
|
+
significant: false
|
178
|
+
strip_insignificant_zeros: false
|
179
|
+
unit: руб.
|
180
|
+
format:
|
181
|
+
delimiter: ! ' '
|
182
|
+
precision: 3
|
183
|
+
separator: ','
|
184
|
+
significant: false
|
185
|
+
strip_insignificant_zeros: false
|
186
|
+
human:
|
187
|
+
decimal_units:
|
188
|
+
format: ! '%n %u'
|
189
|
+
units:
|
190
|
+
billion:
|
191
|
+
few: миллиардов
|
192
|
+
many: миллиардов
|
193
|
+
one: миллиард
|
194
|
+
other: миллиардов
|
195
|
+
million:
|
196
|
+
few: миллионов
|
197
|
+
many: миллионов
|
198
|
+
one: миллион
|
199
|
+
other: миллионов
|
200
|
+
quadrillion:
|
201
|
+
few: квадриллионов
|
202
|
+
many: квадриллионов
|
203
|
+
one: квадриллион
|
204
|
+
other: квадриллионов
|
205
|
+
thousand:
|
206
|
+
few: тысяч
|
207
|
+
many: тысяч
|
208
|
+
one: тысяча
|
209
|
+
other: тысяч
|
210
|
+
trillion:
|
211
|
+
few: триллионов
|
212
|
+
many: триллионов
|
213
|
+
one: триллион
|
214
|
+
other: триллионов
|
215
|
+
unit: ''
|
216
|
+
format:
|
217
|
+
delimiter: ''
|
218
|
+
precision: 1
|
219
|
+
significant: false
|
220
|
+
strip_insignificant_zeros: false
|
221
|
+
storage_units:
|
222
|
+
format: ! '%n %u'
|
223
|
+
units:
|
224
|
+
byte:
|
225
|
+
few: байта
|
226
|
+
many: байт
|
227
|
+
one: байт
|
228
|
+
other: байта
|
229
|
+
gb: ГБ
|
230
|
+
kb: КБ
|
231
|
+
mb: МБ
|
232
|
+
tb: ТБ
|
233
|
+
percentage:
|
234
|
+
format:
|
235
|
+
delimiter: ''
|
236
|
+
precision:
|
237
|
+
format:
|
238
|
+
delimiter: ''
|
239
|
+
support:
|
240
|
+
array:
|
241
|
+
last_word_connector: ! ' и '
|
242
|
+
two_words_connector: ! ' и '
|
243
|
+
words_connector: ! ', '
|
244
|
+
time:
|
245
|
+
am: утра
|
246
|
+
formats:
|
247
|
+
default: ! '%a, %d %b %Y, %H:%M:%S %z'
|
248
|
+
long: ! '%d %B %Y, %H:%M'
|
249
|
+
short: ! '%d %b, %H:%M'
|
250
|
+
pm: вечера
|
251
|
+
# remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository
|
252
|
+
activemodel:
|
253
|
+
errors:
|
254
|
+
<<: *errors
|
255
|
+
activerecord:
|
256
|
+
errors:
|
257
|
+
<<: *errors
|