Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make sure file names are always flattened

  • Loading branch information...
commit 7ff8f9a7e87c1f0c03c52f83c6e8e34d50f5c1ae 1 parent c9259ca
@krekoten krekoten authored svenfuchs committed
Showing with 6 additions and 2 deletions.
  1. +2 −2 lib/i18n/backend/base.rb
  2. +4 −0 test/backend/simple_test.rb
View
4 lib/i18n/backend/base.rb
@@ -11,8 +11,8 @@ module Base
# plain Ruby (*.rb) or YAML files (*.yml). See #load_rb and #load_yml
# for details.
def load_translations(*filenames)
- filenames = I18n.load_path.flatten if filenames.empty?
- filenames.each { |filename| load_file(filename) }
+ filenames = I18n.load_path if filenames.empty?
+ filenames.flatten.each { |filename| load_file(filename) }
end
# This method receives a locale, a data hash and options for storing translations.
View
4 test/backend/simple_test.rb
@@ -42,6 +42,10 @@ def setup
assert_equal expected, translations
end
+ test "simple load_translations: given file names as array it does not raise anything" do
+ assert_nothing_raised { I18n.backend.load_translations(["#{locales_dir}/en.rb", "#{locales_dir}/en.yml"]) }
+ end
+
# storing translations
test "simple store_translations: stores translations, ... no, really :-)" do

0 comments on commit 7ff8f9a

Please sign in to comment.
Something went wrong with that request. Please try again.