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)
244
244
# Loads a plain Ruby translations file. eval'ing the file must yield
245
245
# a Hash containing translation data with locales as toplevel keys.
246
246
def load_rb ( filename )
247
- translations = eval ( IO . read ( filename ) , binding , filename )
247
+ translations = eval ( IO . read ( filename ) , binding , filename . to_s )
248
248
[ translations , false ]
249
249
end
250
250
Original file line number Diff line number Diff line change @@ -31,4 +31,14 @@ def setup
31
31
I18n . load_path << Dir [ locales_dir + '/*.{rb,yml}' ]
32
32
assert_equal "baz" , I18n . t ( :'foo.bar' )
33
33
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
34
44
end
You can’t perform that action at this time.
0 commit comments