active_storage_validations 0.8.2 → 0.9.4
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/README.md +131 -19
- data/config/locales/de.yml +13 -8
- data/config/locales/en.yml +4 -4
- data/config/locales/es.yml +22 -0
- data/config/locales/fr.yml +22 -0
- data/config/locales/it.yml +22 -0
- data/config/locales/ja.yml +22 -0
- data/config/locales/nl.yml +22 -0
- data/config/locales/pl.yml +22 -0
- data/config/locales/pt-BR.yml +22 -0
- data/config/locales/ru.yml +22 -0
- data/config/locales/tr.yml +22 -0
- data/config/locales/uk.yml +22 -0
- data/config/locales/vi.yml +22 -0
- data/lib/active_storage_validations/attached_validator.rb +4 -1
- data/lib/active_storage_validations/content_type_validator.rb +15 -7
- data/lib/active_storage_validations/dimension_validator.rb +5 -5
- data/lib/active_storage_validations/limit_validator.rb +4 -8
- data/lib/active_storage_validations/matchers.rb +43 -0
- data/lib/active_storage_validations/matchers/attached_validator_matcher.rb +59 -0
- data/lib/active_storage_validations/matchers/content_type_validator_matcher.rb +101 -0
- data/lib/active_storage_validations/matchers/dimension_validator_matcher.rb +152 -0
- data/lib/active_storage_validations/matchers/size_validator_matcher.rb +93 -0
- data/lib/active_storage_validations/metadata.rb +14 -3
- data/lib/active_storage_validations/size_validator.rb +1 -1
- data/lib/active_storage_validations/version.rb +1 -1
- metadata +30 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58ef7bbaa01aafa835921f0ad446b86e5b5c49a73a6f08e42feb97ff9bd3c7fd
|
4
|
+
data.tar.gz: e4f18d0de97ffa2adfe59e2d5d841706a8de3e6e575390aafb5b75dbf82a37a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b29620eb2a65e73c9f7c1c9d2bf143ba20aed0e460fdd763d415651b80463821f5dea26d2b28834dae7dc90ad035d6bbaa47bc7e89161365bfb154485a12c8b
|
7
|
+
data.tar.gz: ee7ef332175aca338df8d46de13ac0487f1aa4b5a3d7aa220bd14826b0f73f55377a6475c2b2eb9133d06aae456a2d18bdc4fbec07b7caaf9cd9fa3b8f1dcf5b
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# Active Storage Validations
|
2
2
|
|
3
|
-
|
3
|
+
[](https://github.com/igorkasyanchuk/active_storage_validations/actions)
|
4
|
+
[](https://www.railsjazz.com)
|
5
|
+
[](https://www.patreon.com/igorkasyanchuk)
|
4
6
|
|
5
|
-
|
7
|
+
If you are using `active_storage` gem and you want to add simple validations for it, like presence or content_type you need to write a custom validation method.
|
6
8
|
|
7
|
-
|
9
|
+
This gems doing it for you. Just use `attached: true` or `content_type: 'image/png'` validation.
|
8
10
|
|
9
11
|
## What it can do
|
10
12
|
|
@@ -99,7 +101,7 @@ class User < ApplicationRecord
|
|
99
101
|
end
|
100
102
|
```
|
101
103
|
|
102
|
-
- Aspect
|
104
|
+
- Aspect ratio validation:
|
103
105
|
|
104
106
|
```ruby
|
105
107
|
class User < ApplicationRecord
|
@@ -113,10 +115,11 @@ class User < ApplicationRecord
|
|
113
115
|
# you can also pass dynamic aspect ratio, like :is_4_3, :is_16_9, etc
|
114
116
|
validates :photos, aspect_ratio: :is_4_3
|
115
117
|
end
|
118
|
+
```
|
116
119
|
|
117
120
|
## Internationalization (I18n)
|
118
121
|
|
119
|
-
Active Storage Validations
|
122
|
+
Active Storage Validations uses I18n for error messages. For this, add these keys in your translation file:
|
120
123
|
|
121
124
|
```yml
|
122
125
|
en:
|
@@ -136,19 +139,18 @@ en:
|
|
136
139
|
dimension_height_less_than_or_equal_to: "height must be less than or equal to %{length} pixel."
|
137
140
|
dimension_width_equal_to: "width must be equal to %{length} pixel."
|
138
141
|
dimension_height_equal_to: "height must be equal to %{length} pixel."
|
139
|
-
aspect_ratio_not_square: "
|
140
|
-
aspect_ratio_not_portrait: "
|
141
|
-
aspect_ratio_not_landscape: "
|
142
|
-
aspect_ratio_is_not: "
|
142
|
+
aspect_ratio_not_square: "must be a square image"
|
143
|
+
aspect_ratio_not_portrait: "must be a portrait image"
|
144
|
+
aspect_ratio_not_landscape: "must be a landscape image"
|
145
|
+
aspect_ratio_is_not: "must have an aspect ratio of %{aspect_ratio}"
|
143
146
|
aspect_ratio_unknown: "has an unknown aspect ratio"
|
144
|
-
|
145
147
|
```
|
146
148
|
|
147
|
-
In some cases Active Storage Validations provides variables to help you customize messages:
|
149
|
+
In some cases, Active Storage Validations provides variables to help you customize messages:
|
148
150
|
|
149
|
-
The "content_type_invalid" key has two variables that you can use, a variable named "content_type" containing the content type of the send file and a variable named "
|
151
|
+
The "content_type_invalid" key has two variables that you can use, a variable named "content_type" containing the content type of the send file and a variable named "authorized_types" containing the list of authorized content types.
|
150
152
|
|
151
|
-
|
153
|
+
The variables are not used by default to leave the choice to the user.
|
152
154
|
|
153
155
|
For example :
|
154
156
|
|
@@ -188,33 +190,120 @@ Very simple example of validation with file attached, content type check and cus
|
|
188
190
|
|
189
191
|
[](https://raw.githubusercontent.com/igorkasyanchuk/active_storage_validations/master/docs/preview.png)
|
190
192
|
|
193
|
+
## Test matchers
|
194
|
+
Provides RSpec-compatible and Minitest-compatible matchers for testing the validators.
|
195
|
+
|
196
|
+
### RSpec
|
197
|
+
|
198
|
+
In `spec_helper.rb`, you'll need to require the matchers:
|
199
|
+
|
200
|
+
```ruby
|
201
|
+
require 'active_storage_validations/matchers'
|
202
|
+
```
|
203
|
+
|
204
|
+
And _include_ the module:
|
205
|
+
|
206
|
+
```ruby
|
207
|
+
RSpec.configure do |config|
|
208
|
+
config.include ActiveStorageValidations::Matchers
|
209
|
+
end
|
210
|
+
```
|
211
|
+
|
212
|
+
Example (Note that the options are chainable):
|
213
|
+
|
214
|
+
```ruby
|
215
|
+
describe User do
|
216
|
+
it { is_expected.to validate_attached_of(:avatar) }
|
217
|
+
|
218
|
+
it { is_expected.to validate_content_type_of(:avatar).allowing('image/png', 'image/gif') }
|
219
|
+
it { is_expected.to validate_content_type_of(:avatar).rejecting('text/plain', 'text/xml') }
|
220
|
+
|
221
|
+
it { is_expected.to validate_dimensions_of(:avatar).width(250) }
|
222
|
+
it { is_expected.to validate_dimensions_of(:avatar).height(200) }
|
223
|
+
it { is_expected.to validate_dimensions_of(:avatar).width(250).height(200).with_message('Invalid dimensions.') }
|
224
|
+
it { is_expected.to validate_dimensions_of(:avatar).width_min(200) }
|
225
|
+
it { is_expected.to validate_dimensions_of(:avatar).width_max(500) }
|
226
|
+
it { is_expected.to validate_dimensions_of(:avatar).height_min(100) }
|
227
|
+
it { is_expected.to validate_dimensions_of(:avatar).height_max(300) }
|
228
|
+
it { is_expected.to validate_dimensions_of(:avatar).width_between(200..500) }
|
229
|
+
it { is_expected.to validate_dimensions_of(:avatar).height_between(100..300) }
|
230
|
+
|
231
|
+
it { is_expected.to validate_size_of(:avatar).less_than(50.kilobytes) }
|
232
|
+
it { is_expected.to validate_size_of(:avatar).less_than_or_equal_to(50.kilobytes) }
|
233
|
+
it { is_expected.to validate_size_of(:avatar).greater_than(1.kilobyte) }
|
234
|
+
it { is_expected.to validate_size_of(:avatar).greater_than_or_equal_to(1.kilobyte) }
|
235
|
+
it { is_expected.to validate_size_of(:avatar).between(100..500.kilobytes) }
|
236
|
+
end
|
237
|
+
```
|
238
|
+
|
239
|
+
### Minitest
|
240
|
+
To use the following syntax, make sure you have the [shoulda-context](https://github.com/thoughtbot/shoulda-context) gem up and running. To make use of the matchers you need to require the matchers:
|
241
|
+
|
242
|
+
```ruby
|
243
|
+
require 'active_storage_validations/matchers'
|
244
|
+
```
|
245
|
+
|
246
|
+
And _extend_ the module:
|
247
|
+
|
248
|
+
```ruby
|
249
|
+
class ActiveSupport::TestCase
|
250
|
+
extend ActiveStorageValidations::Matchers
|
251
|
+
end
|
252
|
+
```
|
253
|
+
|
254
|
+
Example (Note that the options are chainable):
|
255
|
+
|
256
|
+
```ruby
|
257
|
+
class UserTest < ActiveSupport::TestCase
|
258
|
+
should validate_attached_of(:avatar)
|
259
|
+
|
260
|
+
should validate_content_type_of(:avatar).allowing('image/png', 'image/gif')
|
261
|
+
should validate_content_type_of(:avatar).rejecting('text/plain', 'text/xml')
|
262
|
+
|
263
|
+
should validate_dimensions_of(:avatar).width(250)
|
264
|
+
should validate_dimensions_of(:avatar).height(200)
|
265
|
+
should validate_dimensions_of(:avatar).width(250).height(200).with_message('Invalid dimensions.')
|
266
|
+
should validate_dimensions_of(:avatar).width_min(200)
|
267
|
+
should validate_dimensions_of(:avatar).width_max(500)
|
268
|
+
should validate_dimensions_of(:avatar).height_min(100)
|
269
|
+
should validate_dimensions_of(:avatar).height_max(300)
|
270
|
+
should validate_dimensions_of(:avatar).width_between(200..500)
|
271
|
+
should validate_dimensions_of(:avatar).height_between(100..300)
|
272
|
+
|
273
|
+
should validate_size_of(:avatar).less_than(50.kilobytes)
|
274
|
+
should validate_size_of(:avatar).less_than_or_equal_to(50.kilobytes)
|
275
|
+
should validate_size_of(:avatar).greater_than(1.kilobyte)
|
276
|
+
should validate_size_of(:avatar).greater_than_or_equal_to(1.kilobyte)
|
277
|
+
should validate_size_of(:avatar).between(100..500.kilobytes)
|
278
|
+
end
|
279
|
+
```
|
280
|
+
|
191
281
|
## Todo
|
192
282
|
|
193
283
|
* verify with remote storages (s3, etc)
|
194
284
|
* verify how it works with direct upload
|
195
285
|
* better error message when content_size is invalid
|
196
286
|
* add more translations
|
197
|
-
* add aspect ratio validation
|
198
287
|
|
199
288
|
## Tests & Contributing
|
200
289
|
|
201
290
|
To run tests in root folder of gem:
|
202
291
|
|
203
292
|
* `BUNDLE_GEMFILE=gemfiles/rails_5_2.gemfile bundle exec rake test` to run for Rails 5.2
|
204
|
-
* `BUNDLE_GEMFILE=gemfiles/
|
205
|
-
|
206
|
-
To play with app `cd test/dummy` and `rails s -b 0.0.0.0` (before `rails db:migrate`).
|
293
|
+
* `BUNDLE_GEMFILE=gemfiles/rails_6_0.gemfile bundle exec rake test` to run for Rails 6.0
|
294
|
+
* `BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle exec rake test` to run for Rails 6.1
|
207
295
|
|
208
296
|
## Known issues
|
209
297
|
|
210
298
|
- There is an issue in Rails which it possible to get if you have added a validation and generating for example an image preview of attachments. It can be fixed with this:
|
211
299
|
|
212
|
-
```
|
300
|
+
```erb
|
213
301
|
<% if @user.avatar.attached? && @user.avatar.attachment.blob.present? && @user.avatar.attachment.blob.persisted? %>
|
214
302
|
<%= image_tag @user.avatar %>
|
215
303
|
<% end %>
|
216
304
|
```
|
217
|
-
|
305
|
+
|
306
|
+
This is a Rails issue, and is fixed in Rails 6.
|
218
307
|
|
219
308
|
## Contributing
|
220
309
|
You are welcome to contribute.
|
@@ -235,7 +324,30 @@ You are welcome to contribute.
|
|
235
324
|
- https://github.com/reed
|
236
325
|
- https://github.com/connorshea
|
237
326
|
- https://github.com/Atul9
|
327
|
+
- https://github.com/victorbueno
|
328
|
+
- https://github.com/UICJohn
|
329
|
+
- https://github.com/giovannibonetti
|
330
|
+
- https://github.com/dlepage
|
331
|
+
- https://github.com/StefSchenkelaars
|
332
|
+
- https://github.com/willnet
|
333
|
+
- https://github.com/mohanklein
|
334
|
+
- https://github.com/High5Apps
|
335
|
+
- https://github.com/mschnitzer
|
336
|
+
- https://github.com/sinankeskin
|
337
|
+
- https://github.com/alejandrodevs
|
338
|
+
- https://github.com/molfar
|
339
|
+
- https://github.com/connorshea
|
340
|
+
- https://github.com/yshmarov
|
341
|
+
- https://github.com/fongfan999
|
342
|
+
- https://github.com/cooperka
|
343
|
+
- https://github.com/dolarsrg
|
344
|
+
- https://github.com/jayshepherd
|
345
|
+
- https://github.com/ohbarye
|
346
|
+
- https://github.com/...
|
238
347
|
|
239
348
|
## License
|
240
349
|
|
241
350
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
351
|
+
|
352
|
+
[<img src="https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/more_gems.png?raw=true"
|
353
|
+
/>](https://www.railsjazz.com/)
|
data/config/locales/de.yml
CHANGED
@@ -2,16 +2,21 @@ de:
|
|
2
2
|
errors:
|
3
3
|
messages:
|
4
4
|
content_type_invalid: "hat einen ungültigen Dateityp"
|
5
|
-
file_size_out_of_range: "Dateigröße
|
5
|
+
file_size_out_of_range: "Dateigröße %{file_size} liegt nicht im erlaubten Bereich"
|
6
6
|
limit_out_of_range: "Anzahl ist außerhalb des gültigen Bereichs"
|
7
|
-
image_metadata_missing: "ist
|
7
|
+
image_metadata_missing: "ist kein gültiges Bild"
|
8
8
|
dimension_min_inclusion: "muss größer oder gleich %{width} x %{height} Pixel sein"
|
9
9
|
dimension_max_inclusion: "muss kleiner oder gleich %{width} x %{height} Pixel sein"
|
10
|
-
dimension_width_inclusion: "
|
11
|
-
dimension_height_inclusion: "
|
12
|
-
dimension_width_greater_than_or_equal_to: "
|
13
|
-
dimension_height_greater_than_or_equal_to: "
|
10
|
+
dimension_width_inclusion: "Bildbreite muss zwischen %{min} und %{max} Pixel liegen"
|
11
|
+
dimension_height_inclusion: "Bildhöhe muss zwischen %{min} und %{max} Pixel liegen"
|
12
|
+
dimension_width_greater_than_or_equal_to: "Bildbreite muss größer oder gleich %{length} Pixel sein"
|
13
|
+
dimension_height_greater_than_or_equal_to: "Bildhöhe muss größer oder gleich %{length} Pixel sein"
|
14
14
|
dimension_width_less_than_or_equal_to: "Breite muss kleiner oder gleich %{length} Pixel sein"
|
15
15
|
dimension_height_less_than_or_equal_to: "Höhe muss kleiner oder gleich %{length} Pixel sein"
|
16
|
-
dimension_width_equal_to: "
|
17
|
-
dimension_height_equal_to: "
|
16
|
+
dimension_width_equal_to: "Bildbreite muss genau %{length} Pixel sein"
|
17
|
+
dimension_height_equal_to: "Bildhöhe muss genau %{length} Pixel sein"
|
18
|
+
aspect_ratio_not_square: "muss quadratisch sein"
|
19
|
+
aspect_ratio_not_portrait: "muss Hochformat sein"
|
20
|
+
aspect_ratio_not_landscape: "muss Querformat sein"
|
21
|
+
aspect_ratio_is_not: "muss ein Bildseitenverhältnis von %{aspect_ratio} haben"
|
22
|
+
aspect_ratio_unknown: "hat ein unbekanntes Bildseitenverhältnis"
|
data/config/locales/en.yml
CHANGED
@@ -15,8 +15,8 @@ en:
|
|
15
15
|
dimension_height_less_than_or_equal_to: "height must be less than or equal to %{length} pixel"
|
16
16
|
dimension_width_equal_to: "width must be equal to %{length} pixel"
|
17
17
|
dimension_height_equal_to: "height must be equal to %{length} pixel"
|
18
|
-
aspect_ratio_not_square: "
|
19
|
-
aspect_ratio_not_portrait: "
|
20
|
-
aspect_ratio_not_landscape: "
|
21
|
-
aspect_ratio_is_not: "
|
18
|
+
aspect_ratio_not_square: "must be a square image"
|
19
|
+
aspect_ratio_not_portrait: "must be a portrait image"
|
20
|
+
aspect_ratio_not_landscape: "must be a landscape image"
|
21
|
+
aspect_ratio_is_not: "must have an aspect ratio of %{aspect_ratio}"
|
22
22
|
aspect_ratio_unknown: "has an unknown aspect ratio"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
es:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "tiene un tipo de contenido inválido"
|
5
|
+
file_size_out_of_range: "tamaño %{file_size} no está entre el rango requerido"
|
6
|
+
limit_out_of_range: "el número total está fuera de rango"
|
7
|
+
image_metadata_missing: "no es una imagen válida"
|
8
|
+
dimension_min_inclusion: "debe ser mayor o igual a %{width} x %{height} pixel"
|
9
|
+
dimension_max_inclusion: "debe ser menor o igual a %{width} x %{height} pixel"
|
10
|
+
dimension_width_inclusion: "el ancho no se incluye entre %{min} y %{max} pixel"
|
11
|
+
dimension_height_inclusion: "la altura no se incluye entre %{min} y %{max} pixel"
|
12
|
+
dimension_width_greater_than_or_equal_to: "el ancho debe ser mayor o igual a %{length} pixel"
|
13
|
+
dimension_height_greater_than_or_equal_to: "la altura debe ser mayor o igual a %{length} pixel"
|
14
|
+
dimension_width_less_than_or_equal_to: "el ancho debe ser menor o igual a %{length} pixel"
|
15
|
+
dimension_height_less_than_or_equal_to: "la altura debe ser menor o igual a %{length} pixel"
|
16
|
+
dimension_width_equal_to: "el ancho debe ser igual a %{length} pixel"
|
17
|
+
dimension_height_equal_to: "la altura debe ser igual a %{length} pixel"
|
18
|
+
aspect_ratio_not_square: "debe ser una imagen cuadrada"
|
19
|
+
aspect_ratio_not_portrait: "debe ser una imagen vertical"
|
20
|
+
aspect_ratio_not_landscape: "debe ser una imagen apaisada"
|
21
|
+
aspect_ratio_is_not: "debe tener una relación de aspecto de %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "tiene una relación de aspecto desconocida"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
fr:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "a un type de contenu non valide"
|
5
|
+
file_size_out_of_range: "la taille %{file_size} n'est pas comprise dans la plage permise"
|
6
|
+
limit_out_of_range: "le nombre total est hors limites"
|
7
|
+
image_metadata_missing: "n'est pas une image valide"
|
8
|
+
dimension_min_inclusion: "doit être supérieur ou égal à %{width} x %{height} pixels"
|
9
|
+
dimension_max_inclusion: "doit être inférieur ou égal à %{width} x %{height} pixels"
|
10
|
+
dimension_width_inclusion: "la largeur n'est pas comprise entre %{min} et %{max} pixels"
|
11
|
+
dimension_height_inclusion: "la hauteur n'est pas comprise entre %{min} et %{max} pixels"
|
12
|
+
dimension_width_greater_than_or_equal_to: "la largeur doit être supérieure ou égale à %{length} pixels"
|
13
|
+
dimension_height_greater_than_or_equal_to: "la hauteur doit être supérieure ou égale à %{length} pixels"
|
14
|
+
dimension_width_less_than_or_equal_to: "la largeur doit être inférieure ou égale à %{length} pixels"
|
15
|
+
dimension_height_less_than_or_equal_to: "la hauteur doit être inférieure ou égale à %{length} pixels"
|
16
|
+
dimension_width_equal_to: "la largeur doit être égale à %{length} pixels"
|
17
|
+
dimension_height_equal_to: "la hauteur doit être égale à %{length} pixels"
|
18
|
+
aspect_ratio_not_square: "doit être une image en format carrée"
|
19
|
+
aspect_ratio_not_portrait: "doit être une image en format portrait"
|
20
|
+
aspect_ratio_not_landscape: "doit être une image en format paysage"
|
21
|
+
aspect_ratio_is_not: "doit avoir un rapport hauteur / largeur de %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "a un rapport d'aspect inconnu"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
it:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "ha un tipo di contenuto non valido"
|
5
|
+
file_size_out_of_range: "la dimensione del file %{file_size} non è compresa nell’intervallo consentito"
|
6
|
+
limit_out_of_range: "il valore è al di fuori dell’intervallo consentito"
|
7
|
+
image_metadata_missing: "non è un'immagine valida"
|
8
|
+
dimension_min_inclusion: "deve essere maggiore o uguale a %{width} x %{height} pixel"
|
9
|
+
dimension_max_inclusion: "deve essere minore o uguale a %{width} x %{height} pixel"
|
10
|
+
dimension_width_inclusion: "la larghezza deve essere compresa tra %{min} e %{max} pixel"
|
11
|
+
dimension_height_inclusion: "l’altezza deve essere compresa tra %{min} e %{max} pixel"
|
12
|
+
dimension_width_greater_than_or_equal_to: "la larghezza deve essere maggiore o uguale a %{length} pixel"
|
13
|
+
dimension_height_greater_than_or_equal_to: "l’altezza deve essere maggiore o uguale a %{length} pixel"
|
14
|
+
dimension_width_less_than_or_equal_to: "la larghezza deve essere minore o uguale a %{length} pixel"
|
15
|
+
dimension_height_less_than_or_equal_to: "l’altezza deve essere minore o uguale a %{length} pixel"
|
16
|
+
dimension_width_equal_to: "la larghezza deve essere pari a %{length} pixel"
|
17
|
+
dimension_height_equal_to: "l’altezza deve essere pari a %{length} pixel"
|
18
|
+
aspect_ratio_not_square: "deve essere un’immagine quadrata"
|
19
|
+
aspect_ratio_not_portrait: "l’orientamento dell’immagine deve essere verticale"
|
20
|
+
aspect_ratio_not_landscape: "l’orientamento dell’immagine deve essere orizzontale"
|
21
|
+
aspect_ratio_is_not: "deve avere un rapporto altezza / larghezza di %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "ha un rapporto altezza / larghezza sconosciuto"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
ja:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "のContent Typeが不正です"
|
5
|
+
file_size_out_of_range: "の容量 %{file_size} が許容範囲外です"
|
6
|
+
limit_out_of_range: "の数が許容範囲外です"
|
7
|
+
image_metadata_missing: "は不正な画像です"
|
8
|
+
dimension_min_inclusion: "は %{width} x %{height} ピクセル以上の大きさにしてください"
|
9
|
+
dimension_max_inclusion: "は %{width} x %{height} ピクセル以下の大きさにしてください"
|
10
|
+
dimension_width_inclusion: "の横幅は %{min} ピクセル以上 %{max} ピクセル以下にしてください"
|
11
|
+
dimension_height_inclusion: "の縦幅は %{min} ピクセル以上 %{max} ピクセル以下にしてください"
|
12
|
+
dimension_width_greater_than_or_equal_to: "の横幅は %{length} ピクセル以上にしてください"
|
13
|
+
dimension_height_greater_than_or_equal_to: "の縦幅は %{length} ピクセル以上にしてください"
|
14
|
+
dimension_width_less_than_or_equal_to: "の横幅は %{length} ピクセル以下にしてください"
|
15
|
+
dimension_height_less_than_or_equal_to: "の縦幅は %{length} ピクセル以下にしてください"
|
16
|
+
dimension_width_equal_to: "の横幅は %{length} ピクセルにしてください"
|
17
|
+
dimension_height_equal_to: "の縦幅は %{length} ピクセルにしてください"
|
18
|
+
aspect_ratio_not_square: "は正方形にしてください"
|
19
|
+
aspect_ratio_not_portrait: "は縦長にしてください"
|
20
|
+
aspect_ratio_not_landscape: "は横長にしてください"
|
21
|
+
aspect_ratio_is_not: "のアスペクト比は %{aspect_ratio} にしてください"
|
22
|
+
aspect_ratio_unknown: "のアスペクト比を取得できませんでした"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
nl:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "heeft een ongeldig inhoudstype"
|
5
|
+
file_size_out_of_range: "bestandsgrootte %{file_size} valt niet tussen het vereiste bereik"
|
6
|
+
limit_out_of_range: "totaal aantal valt buiten het vereiste bereik"
|
7
|
+
image_metadata_missing: "is geen geldige afbeelding"
|
8
|
+
dimension_min_inclusion: "moet groter of gelijk zijn aan %{width} x %{height} pixels"
|
9
|
+
dimension_max_inclusion: "moet kleiner of gelijk zijn aan %{width} x %{height} pixels"
|
10
|
+
dimension_width_inclusion: "breedte niet tussen de %{min} en %{max} pixels"
|
11
|
+
dimension_height_inclusion: "hoogte niet tussen de %{min} en %{max} pixels"
|
12
|
+
dimension_width_greater_than_or_equal_to: "breedte moet groter of gelijk zijn aan %{length} pixels"
|
13
|
+
dimension_height_greater_than_or_equal_to: "hoogte moet groter of gelijk zijn aan %{length} pixels"
|
14
|
+
dimension_width_less_than_or_equal_to: "breedte moet kleiner of gelijk zijn aan %{length} pixels"
|
15
|
+
dimension_height_less_than_or_equal_to: "hoogte moet kleiner of gelijk zijn aan %{length} pixels"
|
16
|
+
dimension_width_equal_to: "breedte moet gelijk zijn aan %{length} pixels"
|
17
|
+
dimension_height_equal_to: "hoogte moet gelijk zijn aan %{length} pixels"
|
18
|
+
aspect_ratio_not_square: "moet een vierkante afbeelding zijn"
|
19
|
+
aspect_ratio_not_portrait: "moet een staande afbeelding zijn"
|
20
|
+
aspect_ratio_not_landscape: "moet een liggende afbeelding zijn"
|
21
|
+
aspect_ratio_is_not: "moet een beeldverhouding hebben van %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "heeft een onbekende beeldverhouding"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
pl:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "jest nieprawidłowego typu"
|
5
|
+
file_size_out_of_range: "rozmiar %{file_size} nie zawiera się w dopuszczalnym zakresie"
|
6
|
+
limit_out_of_range: "ilość przekracza dopuszczalny zakres"
|
7
|
+
image_metadata_missing: "nie jest prawidłowym obrazem"
|
8
|
+
dimension_min_inclusion: "musi być równe lub większe od %{width} x %{height} pixeli"
|
9
|
+
dimension_max_inclusion: "musi być równe lub mniejsze od %{width} x %{height} pixeli"
|
10
|
+
dimension_width_inclusion: "szerokość musi wynosić od %{min} do %{max} pixeli"
|
11
|
+
dimension_height_inclusion: "wysokość musi wynosić od %{min} do %{max} pixeli"
|
12
|
+
dimension_width_greater_than_or_equal_to: "szerokość musi mieć co najmniej %{length} pixeli"
|
13
|
+
dimension_height_greater_than_or_equal_to: "wysokość musi mieć co najmniej %{length} pixeli"
|
14
|
+
dimension_width_less_than_or_equal_to: "szerokość musi mieć co najwyżej %{length} pixeli"
|
15
|
+
dimension_height_less_than_or_equal_to: "wysokość musi mieć co najwyżej %{length} pixeli"
|
16
|
+
dimension_width_equal_to: "szerokość musi wynosić %{length} pixeli"
|
17
|
+
dimension_height_equal_to: "wysokość musi wynosić %{length} pixeli"
|
18
|
+
aspect_ratio_not_square: "musi mieć proporcje kwadratu"
|
19
|
+
aspect_ratio_not_portrait: "musi mieć proporcje portretu"
|
20
|
+
aspect_ratio_not_landscape: "musi mieć proporcje pejzażu"
|
21
|
+
aspect_ratio_is_not: "musi mieć proporcje %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "ma nieokreślone proporcje"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
pt-BR:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "tem um tipo de arquivo inválido"
|
5
|
+
file_size_out_of_range: "tamanho %{file_size} está fora da faixa de tamanho válida"
|
6
|
+
limit_out_of_range: "número total está fora do limite"
|
7
|
+
image_metadata_missing: "não é uma imagem válida"
|
8
|
+
dimension_min_inclusion: "deve ser maior ou igual a %{width} x %{height} pixel"
|
9
|
+
dimension_max_inclusion: "deve ser menor ou igual a %{width} x %{height} pixel"
|
10
|
+
dimension_width_inclusion: "largura não está entre %{min} e %{max} pixel"
|
11
|
+
dimension_height_inclusion: "altura não está entre %{min} e %{max} pixel"
|
12
|
+
dimension_width_greater_than_or_equal_to: "largura deve ser maior ou igual a %{length} pixel"
|
13
|
+
dimension_height_greater_than_or_equal_to: "altura deve ser maior ou igual a %{length} pixel"
|
14
|
+
dimension_width_less_than_or_equal_to: "largura deve ser menor ou igual a %{length} pixel"
|
15
|
+
dimension_height_less_than_or_equal_to: "altura deve ser menor ou igual a %{length} pixel"
|
16
|
+
dimension_width_equal_to: "largura deve ser igual a %{length} pixel"
|
17
|
+
dimension_height_equal_to: "altura deve ser igual a %{length} pixel"
|
18
|
+
aspect_ratio_not_square: "não é uma imagem quadrada"
|
19
|
+
aspect_ratio_not_portrait: "não contém uma imagem no formato retrato"
|
20
|
+
aspect_ratio_not_landscape: "não contém uma imagem no formato paisagem"
|
21
|
+
aspect_ratio_is_not: "não contém uma proporção de %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "não tem uma proporção definida"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
ru:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "имеет недопустимый тип содержимого"
|
5
|
+
file_size_out_of_range: "размер %{file_size} больше требуемого"
|
6
|
+
limit_out_of_range: "количество файлов больше требуемого"
|
7
|
+
image_metadata_missing: "не является допустимым изображением"
|
8
|
+
dimension_min_inclusion: "должен быть больше или равно %{width} x %{height} пикселям"
|
9
|
+
dimension_max_inclusion: "должно быть меньше или равно %{width} x %{height} пикселям"
|
10
|
+
dimension_width_inclusion: "ширина не включена между %{min} и %{max} пикселям"
|
11
|
+
dimension_height_inclusion: "высота не включена между %{min} и %{max} пикселям"
|
12
|
+
dimension_width_greater_than_or_equal_to: "ширина должна быть больше или равна %{length} пикселям"
|
13
|
+
dimension_height_greater_than_or_equal_to: "высота должна быть больше или равна %{length} пикселям"
|
14
|
+
dimension_width_less_than_or_equal_to: "ширина должна быть меньше или равна %{length} пикселям"
|
15
|
+
dimension_height_less_than_or_equal_to: "высота должна быть меньше или равна %{length} пикселям"
|
16
|
+
dimension_width_equal_to: "ширина должна быть равна %{length} пикселям"
|
17
|
+
dimension_height_equal_to: "высота должна быть равна %{length} пикселям"
|
18
|
+
aspect_ratio_not_square: "должно быть квадратное изображение"
|
19
|
+
aspect_ratio_not_portrait: "должно быть портретное изображение"
|
20
|
+
aspect_ratio_not_landscape: "должно быть пейзажное изображение"
|
21
|
+
aspect_ratio_is_not: "должен иметь соотношение сторон %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "имеет неизвестное соотношение сторон"
|