$container['i18n'] = function ($c) {
$i18n = $c->get('session')->i18n;
- if (!$i18n || !$i18n->getId()) {
- $i18n = new Galette\Core\I18n();
+ if (!$i18n || !$i18n->getId() || $_GET['ui_pref_lang']) {
+ $i18n = new Galette\Core\I18n($_GET['ui_pref_lang'] ?? false);
$c->get('session')->i18n = $i18n;
}
return $i18n;
);
require_once '../includes/dependencies.php';
-if (isset($_GET['pref_lang'])) {
- $i18n->changeLanguage($_GET['pref_lang']);
-}
-
if (isset($_POST['abort_btn'])) {
if (isset($session[md5(GALETTE_ROOT)])) {
unset($session[md5(GALETTE_ROOT)]);
<link rel="stylesheet" type="text/css" href="./themes/default/galette.css"/>
<link rel="stylesheet" type="text/css" href="./themes/default/install.css"/>
<link rel="stylesheet" type="text/css" href="./themes/default/jquery-ui/jquery-ui-<?php echo JQUERY_UI_VERSION; ?>.custom.css"/>
+ <link rel="stylesheet" type="text/css" href="./js/selectize-0.12.6/css/selectize.css" />
+ <link rel="stylesheet" type="text/css" href="./js/selectize-0.12.6/css/selectize.default.css" />
<script type="text/javascript" src="./js/jquery/jquery-<?php echo JQUERY_VERSION; ?>.min.js"></script>
<script type="text/javascript" src="./js/jquery/jquery-migrate-<?php echo JQUERY_MIGRATE_VERSION; ?>.min.js"></script>
<script type="text/javascript" src="./js/jquery/jquery-ui-<?php echo JQUERY_UI_VERSION; ?>/jquery.ui.widget.min.js"></script>
<script type="text/javascript" src="./js//jquery/jquery-ui-<?php echo JQUERY_UI_VERSION; ?>/jquery.ui.button.min.js"></script>
<script type="text/javascript" src="./js/jquery/jquery-ui-<?php echo JQUERY_UI_VERSION; ?>/jquery.ui.tooltip.min.js"></script>
+ <script type="text/javascript" src="./js/selectize-0.12.6/js/standalone/selectize.min.js"></script>
<script type="text/javascript" src="./js/jquery/jquery.bgFade.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<link rel="shortcut icon" href="./themes/default/images/favicon.png" />
<?php
foreach ($i18n->getList() as $langue) {
?>
- <option value="<?php echo $langue->getID(); ?>" lang="<?php echo $langue->getAbbrev(); ?>"<?php if ($galette_lang == $langue->getAbbrev()) { echo ' selected="selected"'; } ?>><?php echo $langue->getName(); ?></option>
+ <option value="<?php echo $langue->getID(); ?>" lang="<?php echo $langue->getAbbrev(); ?>"<?php if ($i18n->getAbbrev() == $langue->getAbbrev()) { echo ' selected="selected"'; } ?>><?php echo $langue->getName(); ?></option>
<?php
}
?>