From 7f8de77e238d0fcdc83b66daa6a787799588f78f Mon Sep 17 00:00:00 2001 From: "severoiuliano@gmail.com" Date: Sun, 24 May 2020 23:07:30 +0200 Subject: [PATCH] changed way of obtaining labels --- system/Controllers/SetupController.php | 29 ++------------------------ 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/system/Controllers/SetupController.php b/system/Controllers/SetupController.php index bd7f86d..e86ed78 100644 --- a/system/Controllers/SetupController.php +++ b/system/Controllers/SetupController.php @@ -52,31 +52,9 @@ class SetupController extends Controller $setuperrors = empty($systemcheck) ? false : 'Some system requirements for Typemill are missing.'; $systemcheck = empty($systemcheck) ? false : $systemcheck; - # Get the translated strings - $labels = $this->getSetupLabels(); - - return $this->render($response, 'auth/setup.twig', array( 'messages' => $setuperrors, 'systemcheck' => $systemcheck, 'labels' => $labels )); + return $this->render($response, 'auth/setup.twig', array( 'messages' => $setuperrors, 'systemcheck' => $systemcheck )); } - public function getSetupLabels() - { - # Check which languages are available - $langs = []; - $path = __DIR__ . '/../author/languages/*.yaml'; - foreach (glob($path) as $filename) { - $langs[] = basename($filename,'.yaml'); - } - - # Detect browser language - $accept_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); - $lang = in_array($accept_lang, $langs) ? $accept_lang : 'en'; - - # At least in the setup phase noon there should be no plugins and the theme should be typemill - $labels = \Typemill\Settings::getLanguageLabels($lang,'typemill',[]); - - return $labels; - } - public function create($request, $response, $args) { @@ -122,9 +100,6 @@ class SetupController extends Controller /* store updated settings */ \Typemill\Settings::updateSettings(array('welcome' => false)); - # Get the translated strings - $labels = $this->getSetupLabels(); - - return $this->render($response, 'auth/welcome.twig', array( 'labels' => $labels )); + return $this->render($response, 'auth/welcome.twig', array()); } } \ No newline at end of file