Skip to content

Commit 21e0d27

Browse files
committed
Fixed i18n override problem with rails 4
1 parent a5cc1c0 commit 21e0d27

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/carrierwave.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ class Railtie < Rails::Railtie
9292
require 'carrierwave/orm/activerecord'
9393
end
9494
end
95+
96+
##
97+
# Loads the Carrierwave locale files before the Rails application locales
98+
# letting the Rails application overrite the carrierwave locale defaults
99+
config.before_configuration do
100+
I18n.load_path << File.join(File.dirname(__FILE__), "carrierwave", "locale", 'en.yml')
101+
end
95102
end
96103
end
97104

lib/carrierwave/validations/active_model.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,3 @@ def validates_download_of(*attr_names)
7878
end
7979
end
8080
end
81-
82-
I18n.load_path << File.join(File.dirname(__FILE__), "..", "locale", 'en.yml')

0 commit comments

Comments
 (0)