FIX: Allow theme translations to be accessed in initializers (#8285)
Previously theme translations were loaded along with other plugin API scripts. These run after pre-initializers and initializers when the app boots. This commit moves theme translation loading into pre-initializers, so their behaviour matches core translations more closely.
This commit is contained in:
@@ -208,8 +208,8 @@ class ThemeJavascriptCompiler
|
||||
@content << script + "\n"
|
||||
end
|
||||
|
||||
def append_module(script, name)
|
||||
script.prepend theme_variables
|
||||
def append_module(script, name, include_variables: true)
|
||||
script = "#{theme_variables}#{script}" if include_variables
|
||||
template = Tilt::ES6ModuleTranspilerTemplate.new {}
|
||||
@content << template.module_transpile(script, "", name)
|
||||
rescue MiniRacer::RuntimeError => ex
|
||||
|
||||
Reference in New Issue
Block a user