Class: InertiaI18n::Parsers::SvelteParser

Inherits:
BaseParser
  • Object
show all
Includes:
JavascriptParsing
Defined in:
lib/inertia_i18n/parsers/svelte_parser.rb

Instance Method Summary collapse

Methods inherited from BaseParser

#extract_keys, #initialize

Constructor Details

This class inherits a constructor from InertiaI18n::Parsers::BaseParser

Instance Method Details

#extract_keys_from_content(content) ⇒ Object



8
9
10
11
12
13
# File 'lib/inertia_i18n/parsers/svelte_parser.rb', line 8

def extract_keys_from_content(content)
  # Svelte files are a mix of HTML and JS.
  # Our improved JavascriptParsing is now robust enough to find t()
  # calls anywhere in the file (script or template).
  extract_javascript_keys(content)
end