From 5df20fda119b8f178fd41002074fbb7bef87df7d Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 6 Apr 2016 20:13:34 +0200 Subject: [PATCH] Issue 2241: added language selector to the admin wizard --- mod/install.php | 5 +++++ view/templates/htconfig.tpl | 4 ++++ view/templates/install_settings.tpl | 1 + 3 files changed, 10 insertions(+) diff --git a/mod/install.php b/mod/install.php index 8434b38e38..7013070764 100755 --- a/mod/install.php +++ b/mod/install.php @@ -77,6 +77,7 @@ function install_post(&$a) { $dbdata = notags(trim($_POST['dbdata'])); $phpath = notags(trim($_POST['phpath'])); $timezone = notags(trim($_POST['timezone'])); + $language = notags(trim($_POST['language'])); $adminmail = notags(trim($_POST['adminmail'])); // connect to db @@ -89,6 +90,7 @@ function install_post(&$a) { '$dbpass' => $dbpass, '$dbdata' => $dbdata, '$timezone' => $timezone, + '$language' => $language, '$urlpath' => $urlpath, '$phpath' => $phpath, '$adminmail' => $adminmail @@ -273,6 +275,8 @@ function install_content(&$a) { $adminmail = notags(trim($_POST['adminmail'])); $timezone = ((x($_POST,'timezone')) ? ($_POST['timezone']) : 'America/Los_Angeles'); + /* Installed langs */ + $lang_choices = get_avaiable_languages(); $tpl = get_markup_template('install_settings.tpl'); $o .= replace_macros($tpl, array( @@ -292,6 +296,7 @@ function install_content(&$a) { '$timezone' => field_timezone('timezone', t('Please select a default timezone for your website'), $timezone, ''), + '$language' => array('language', t('System Language:'), $language, t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices), '$baseurl' => $a->get_baseurl(), diff --git a/view/templates/htconfig.tpl b/view/templates/htconfig.tpl index 6b3bda6173..971bb50482 100644 --- a/view/templates/htconfig.tpl +++ b/view/templates/htconfig.tpl @@ -20,6 +20,10 @@ $a->path = '{{$urlpath}}'; $default_timezone = '{{$timezone}}'; +// Default system language + +$a->config['system']['language'] = '{{$language}}'; + // What is your site name? $a->config['sitename'] = "My Friend Network"; diff --git a/view/templates/install_settings.tpl b/view/templates/install_settings.tpl index 8d6823f114..5584e14365 100644 --- a/view/templates/install_settings.tpl +++ b/view/templates/install_settings.tpl @@ -19,6 +19,7 @@ {{include file="field_input.tpl" field=$adminmail}} {{$timezone}} +{{include file="field_select.tpl" field=$language}} -- 2.39.5