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:
David Taylor
2019-11-05 11:54:12 +00:00
committed by GitHub
parent c008443f2d
commit ee5799805c
2 changed files with 17 additions and 12 deletions

View File

@ -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