File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ def load_file(filename)
244244 # Loads a plain Ruby translations file. eval'ing the file must yield
245245 # a Hash containing translation data with locales as toplevel keys.
246246 def load_rb ( filename )
247- translations = eval ( IO . read ( filename ) , binding , filename )
247+ translations = eval ( IO . read ( filename ) , binding , filename . to_s )
248248 [ translations , false ]
249249 end
250250
Original file line number Diff line number Diff line change @@ -31,4 +31,14 @@ def setup
3131 I18n . load_path << Dir [ locales_dir + '/*.{rb,yml}' ]
3232 assert_equal "baz" , I18n . t ( :'foo.bar' )
3333 end
34+
35+ test "adding Pathnames to the load path does not break YML file locale loading" do
36+ I18n . load_path << Pathname . new ( locales_dir + '/en.yml' )
37+ assert_equal "baz" , I18n . t ( :'foo.bar' )
38+ end
39+
40+ test "adding Pathnames to the load path does not break Ruby file locale loading" do
41+ I18n . load_path << Pathname . new ( locales_dir + '/en.rb' )
42+ assert_equal "bas" , I18n . t ( :'fuh.bah' )
43+ end
3444end
You can’t perform that action at this time.
0 commit comments