Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #423 from Shopify/fix-tests
Browse files Browse the repository at this point in the history
[Fix] Excluded keyword in i18n tests
  • Loading branch information
haeky committed May 26, 2015
2 parents cd7a3c4 + 62f15d2 commit dc9ece5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/helpers/i18n_helper.rb
Expand Up @@ -2,6 +2,7 @@

def match_tags(path)
File.open(path).read.scan(/\{\{\s*(?:'|")([a-z0-9._]+?)(?:'|")(?:\s*\|\s*t)/).flatten.map do |key|
next if include_excluded_keywords?(key)
truncate_plural_key(key.split('.'))
end.uniq
end
Expand All @@ -19,7 +20,7 @@ def truncate_plural_key(key)
end

def include_excluded_keywords?(key)
key.include?(*EXCLUDED_KEYWORDS)
EXCLUDED_KEYWORDS.any? { |w| key.include?(w) }
end

def locale_name_from_path(path)
Expand Down

0 comments on commit dc9ece5

Please sign in to comment.