Skip to content
Snippets Groups Projects
Commit e2b3753f authored by Markus Reiter's avatar Markus Reiter
Browse files

Style changes in `language_eval`.

parent ef26bf18
No related branches found
No related tags found
No related merge requests found
......@@ -114,22 +114,25 @@ module Hbc
@language_blocks.default = block
else
language_eval
@language
end
end
def language_eval
return if instance_variable_defined?(:@language)
return @language if instance_variable_defined?(:@language)
return unless instance_variable_defined?(:@language_blocks)
if @language_blocks.nil? || @language_blocks.empty?
return @language = nil
end
MacOS.languages.map(&Locale.method(:parse)).any? { |locale|
MacOS.languages.map(&Locale.method(:parse)).each do |locale|
key = @language_blocks.keys.detect { |strings|
strings.any? { |string| locale.include?(string) }
}
return @language = @language_blocks[key].call unless key.nil?
}
next if key.nil?
return @language = @language_blocks[key].call
end
@language = @language_blocks.default.call
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment