mirror of
https://github.com/flarum/core.git
synced 2025-08-17 05:44:13 +02:00
Rework extension bootstrapping
System JS modules don't execute when they're registered, so we need to import them explicitly. While we're at it, we may as well make the locale bootstrapper a module too.
This commit is contained in:
@@ -13,14 +13,18 @@ class JsCompiler extends RevisionCompiler
|
||||
|
||||
public function compile()
|
||||
{
|
||||
$output = "var initLocale = function(app) {
|
||||
app.translator.translations = ".json_encode($this->translations).";";
|
||||
$output = "System.register('locale', [], function() {
|
||||
return {
|
||||
execute: function() {
|
||||
app.translator.translations = ".json_encode($this->translations).";\n";
|
||||
|
||||
foreach ($this->files as $filename) {
|
||||
$output .= file_get_contents($filename);
|
||||
}
|
||||
|
||||
$output .= "};";
|
||||
$output .= "}
|
||||
};
|
||||
});";
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
Reference in New Issue
Block a user