Class: I18nInterpolationKeysFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n/i18n_interpolation_keys_finder.rb

Class Method Summary collapse

Class Method Details

.find(text) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/i18n/i18n_interpolation_keys_finder.rb', line 4

def self.find(text)
  pattern = Regexp.union([*I18n.config.interpolation_patterns, /\{\{(\w+)\}\}/])
  keys = text.scan(pattern)
  keys.flatten!
  keys.compact!
  keys.uniq!
  keys
end