mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-26 07:43:00 +00:00
generate local file on install rather than load
This commit is contained in:
@@ -9,6 +9,9 @@ module ValidatesTimeliness
|
||||
copy_file 'validates_timeliness.rb', 'config/initializers/validates_timeliness.rb'
|
||||
end
|
||||
|
||||
def copy_locale_file
|
||||
copy_file 'en.yml', 'config/locales/validates_timeliness.en.yml'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
16
lib/generators/validates_timeliness/templates/en.yml
Normal file
16
lib/generators/validates_timeliness/templates/en.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
en:
|
||||
errors:
|
||||
messages:
|
||||
invalid_date: "is not a valid date"
|
||||
invalid_time: "is not a valid time"
|
||||
invalid_datetime: "is not a valid datetime"
|
||||
is_at: "must be at %{restriction}"
|
||||
before: "must be before %{restriction}"
|
||||
on_or_before: "must be on or before %{restriction}"
|
||||
after: "must be after %{restriction}"
|
||||
on_or_after: "must be on or after %{restriction}"
|
||||
validates_timeliness:
|
||||
error_value_formats:
|
||||
date: '%Y-%m-%d'
|
||||
time: '%H:%M:%S'
|
||||
datetime: '%Y-%m-%d %H:%M:%S'
|
||||
Reference in New Issue
Block a user