From 935fb59dba73b714b3ee81941326d8940d3f5d88 Mon Sep 17 00:00:00 2001 From: Oriol Collell Date: Fri, 19 Oct 2018 12:07:45 +0200 Subject: [PATCH] fix rubocop issues --- lib/rosetta.rb | 1 + lib/rosetta/repositories/local.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rosetta.rb b/lib/rosetta.rb index 5db8a6c..82e313e 100644 --- a/lib/rosetta.rb +++ b/lib/rosetta.rb @@ -60,6 +60,7 @@ def build_phrases_from_translations(translations, phrases, current_key = []) build_phrases_from_translations(value, phrases, current_key + [key]) else next if value.blank? + phrases << build_phrase(keys: current_key + [key], phrase: value) end end diff --git a/lib/rosetta/repositories/local.rb b/lib/rosetta/repositories/local.rb index 4706475..0c9d643 100644 --- a/lib/rosetta/repositories/local.rb +++ b/lib/rosetta/repositories/local.rb @@ -28,7 +28,7 @@ def file_translations(filename) # rubocop:disable Style/Send def load_translations_in_file(filename) type = File.extname(filename).tr('.', '').downcase - return {} unless type == 'yml' || type == 'yaml' + return {} unless %w[yml yaml].include?(type) translations = I18n.backend.send(:load_yml, filename) unless translations.is_a?(Hash)