1
0
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:
Toby Zerner
2015-07-20 18:08:28 +09:30
parent 19fe138770
commit 6b7cf1b6bf
12 changed files with 130 additions and 59 deletions

View File

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