1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-06 06:07:31 +02:00

update to version136

This commit is contained in:
severoiuliano@gmail.com
2020-04-30 17:19:16 +02:00
parent 29f213f1f2
commit b4f2cc9950
20 changed files with 363 additions and 168 deletions

View File

@@ -52,9 +52,32 @@ class SetupController extends Controller
$setuperrors = empty($systemcheck) ? false : 'Some system requirements for Typemill are missing.';
$systemcheck = empty($systemcheck) ? false : $systemcheck;
return $this->render($response, 'auth/setup.twig', array( 'messages' => $setuperrors, 'systemcheck' => $systemcheck ));
# Get the translated strings
$labels = $this->getSetupLabels();
return $this->render($response, 'auth/setup.twig', array( 'messages' => $setuperrors, 'systemcheck' => $systemcheck, 'labels' => $labels ));
}
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)
{
if($request->isPost())
@@ -98,7 +121,10 @@ 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());
return $this->render($response, 'auth/welcome.twig', array( 'labels' => $labels ));
}
}