UX: rate limiter message will say to wait "a few seconds" instead of 0 to 3 seconds
This commit is contained in:
parent
913d97e780
commit
320cd9a19e
|
@ -600,6 +600,7 @@ en:
|
|||
seconds:
|
||||
one: "1 second"
|
||||
other: "%{count} seconds"
|
||||
short_time: "a few seconds"
|
||||
|
||||
datetime:
|
||||
distance_in_words:
|
||||
|
|
|
@ -11,7 +11,9 @@ class RateLimiter
|
|||
|
||||
def description
|
||||
time_left = ""
|
||||
if @available_in < 1.minute.to_i
|
||||
if @available_in <= 3
|
||||
time_left = I18n.t("rate_limiter.short_time")
|
||||
elsif @available_in < 1.minute.to_i
|
||||
time_left = I18n.t("rate_limiter.seconds", count: @available_in)
|
||||
elsif @available_in < 1.hour.to_i
|
||||
time_left = I18n.t("rate_limiter.minutes", count: (@available_in / 1.minute.to_i))
|
||||
|
|
Loading…
Reference in New Issue