Skip to content

Commit

Permalink
fix issue #3: support for false value in .yml files
Browse files Browse the repository at this point in the history
  • Loading branch information
pejuko committed Sep 25, 2016
1 parent 819303b commit 02d99b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/i18n/translate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def self.find(key, hash, separator=".")
path = key.to_s.split(separator)
path.each do |key|
h = h[key]
return nil unless h
return nil if h.nil?
end
h
end
Expand Down Expand Up @@ -247,7 +247,7 @@ def self.valid_file?(fname, format=Translate::DEFAULT_OPTIONS[:format])
# }
def [](key)
d = I18n::Translate.find(key, @default, @options[:separator])
raise "Translate#[key]: wrong key '#{key}'" unless d
raise "Translate#[key]: wrong key '#{key}'" if d.nil?

entry = {"key" => key, "default" => d}
if d.kind_of? Hash
Expand Down

0 comments on commit 02d99b6

Please sign in to comment.