Class: I18nInterpolationKeysFinder
- Inherits:
-
Object
- Object
- I18nInterpolationKeysFinder
- 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 12 |
# File 'lib/i18n/i18n_interpolation_keys_finder.rb', line 4 def self.find(text) return [] unless text.is_a?(String) pattern = Regexp.union([*I18n.config.interpolation_patterns, /\{\{(\w+)\}\}/]) keys = text.scan(pattern) keys.flatten! keys.compact! keys.uniq! keys end |