File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
activesupport/lib/active_support Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -60,17 +60,19 @@ def self.initialize_i18n(app)
60
60
# Restore available locales check so it will take place from now on.
61
61
I18n . enforce_available_locales = enforce_available_locales
62
62
63
- directories = watched_dirs_with_extensions ( reloadable_paths )
64
- reloader = app . config . file_watcher . new ( I18n . load_path . dup , directories ) do
65
- I18n . load_path . keep_if { |p | File . exist? ( p ) }
66
- I18n . load_path |= reloadable_paths . flat_map ( &:existent )
67
- end
63
+ unless app . config . cache_classes
64
+ directories = watched_dirs_with_extensions ( reloadable_paths )
65
+ reloader = app . config . file_watcher . new ( I18n . load_path . dup , directories ) do
66
+ I18n . load_path . keep_if { |p | File . exist? ( p ) }
67
+ I18n . load_path |= reloadable_paths . flat_map ( &:existent )
68
+ end
68
69
69
- app . reloaders << reloader
70
- app . reloader . to_run do
71
- reloader . execute_if_updated { require_unload_lock! }
70
+ app . reloaders << reloader
71
+ app . reloader . to_run do
72
+ reloader . execute_if_updated { require_unload_lock! }
73
+ end
74
+ reloader . execute
72
75
end
73
- reloader . execute
74
76
75
77
@i18n_inited = true
76
78
end
You can’t perform that action at this time.
0 commit comments