2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-06-15 04:08:23 -04:00
|
|
|
class I18nInterpolationKeysFinder
|
|
|
|
def self.find(text)
|
2020-08-03 09:57:29 -04:00
|
|
|
pattern = Regexp.union([*I18n.config.interpolation_patterns, /\{\{(\w+)\}\}/])
|
|
|
|
keys = text.scan(pattern)
|
2017-06-15 04:08:23 -04:00
|
|
|
keys.flatten!
|
|
|
|
keys.compact!
|
|
|
|
keys.uniq!
|
|
|
|
keys
|
|
|
|
end
|
|
|
|
end
|