mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Move I18n to options
This commit is contained in:
@@ -14,6 +14,10 @@ module Liquid
|
||||
# template.render('user_name' => 'bob')
|
||||
#
|
||||
class Template
|
||||
DEFAULT_OPTIONS = {
|
||||
:locale => I18n.new
|
||||
}
|
||||
|
||||
attr_accessor :root, :resource_limits
|
||||
@@file_system = BlankFileSystem.new
|
||||
|
||||
@@ -68,7 +72,7 @@ module Liquid
|
||||
# Parse source code.
|
||||
# Returns self for easy chaining
|
||||
def parse(source, options = {})
|
||||
@root = Document.new(tokenize(source), options)
|
||||
@root = Document.new(tokenize(source), DEFAULT_OPTIONS.merge(options))
|
||||
@warnings = nil
|
||||
self
|
||||
end
|
||||
@@ -79,7 +83,7 @@ module Liquid
|
||||
end
|
||||
|
||||
def registers
|
||||
@registers ||= {:locale => Liquid::I18n.new}
|
||||
@registers ||= {}
|
||||
end
|
||||
|
||||
def assigns
|
||||
|
||||
Reference in New Issue
Block a user