File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ * Optimize load time for ` Railtie#initialize_i18n ` . Filter ` I18n.load_path ` s passed to the file watcher to only those
2
+ under ` Rails.root ` . Previously the watcher would grab all available locales, including those in gems
3
+ which do not require a watcher because they won't change.
4
+
5
+ * Nick Schwaderer*
6
+
1
7
* Add a ` filter ` option to ` in_order_of ` to prioritize certain values in the sorting without filtering the results
2
8
by these values.
3
9
Original file line number Diff line number Diff line change @@ -62,8 +62,9 @@ def self.initialize_i18n(app)
62
62
63
63
if app . config . reloading_enabled?
64
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 ) }
65
+ root_load_paths = I18n . load_path . select { |path | path . start_with? ( Rails . root . to_s ) }
66
+ reloader = app . config . file_watcher . new ( root_load_paths , directories ) do
67
+ I18n . load_path . delete_if { |p | p . start_with? ( Rails . root . to_s ) && !File . exist? ( p ) }
67
68
I18n . load_path |= reloadable_paths . flat_map ( &:existent )
68
69
end
69
70
You can’t perform that action at this time.
0 commit comments