Add ability for jump to be translated into other languages

This commit is contained in:
Dale Davies
2023-04-06 17:49:27 +01:00
parent 5414f2b644
commit 0c2c320c75
26 changed files with 267 additions and 37 deletions

View File

@@ -13,19 +13,20 @@
namespace Jump;
use Nette\Routing\RouteList;
class Main {
private Cache $cache;
private Config $config;
private Language $language;
private \Nette\Http\Request $request;
private \Nette\Routing\RouteList $router;
private \Nette\Http\Session $session;
public function __construct() {
$this->config = new Config();
$this->cache = new Cache($this->config);
$this->router = new RouteList;
$this->router = new \Nette\Routing\RouteList;
$this->language = new Language($this->config, $this->cache);
// Set up the routes that Jump expects.
$this->router->addRoute('/', [
@@ -65,7 +66,7 @@ class Main {
// Instantiate the correct class to build the requested page, get the
// content and return it.
$page = new $outputclass($this->config, $this->cache, $this->session, $matchedroute ?? null);
$page = new $outputclass($this->config, $this->cache, $this->session, $this->language, $matchedroute ?? null);
return $page->get_output();
}