summaryrefslogtreecommitdiff
path: root/actions/siteadminpanel.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-08 22:12:12 -0500
committerEvan Prodromou <evan@status.net>2009-11-08 22:12:12 -0500
commit33f931d5277e0d72f5c9082d176a1a574f033e87 (patch)
tree903d8cd0076b388d6b32dadf3eb63961f95b8e4c /actions/siteadminpanel.php
parent977d5d6f8569437a8d8a7f9616f4de6afc0dc509 (diff)
add default language to site admin panel
Diffstat (limited to 'actions/siteadminpanel.php')
-rw-r--r--actions/siteadminpanel.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/actions/siteadminpanel.php b/actions/siteadminpanel.php
index f66aa855c..2da26e4bd 100644
--- a/actions/siteadminpanel.php
+++ b/actions/siteadminpanel.php
@@ -90,7 +90,8 @@ class SiteadminpanelAction extends AdminPanelAction
function saveSettings()
{
- static $settings = array('name', 'broughtby', 'broughtbyurl', 'email', 'timezone');
+ static $settings = array('name', 'broughtby', 'broughtbyurl',
+ 'email', 'timezone', 'language');
$values = array();
@@ -143,6 +144,12 @@ class SiteadminpanelAction extends AdminPanelAction
$this->clientError(_('Timezone not selected.'));
return;
}
+
+ // Validate language
+
+ if (!is_null($language) && !in_array($language, array_keys(get_nice_language_list()))) {
+ $this->clientError(sprintf(_('Unknown language "%s"'), $language));
+ }
}
}
@@ -209,6 +216,10 @@ class SiteAdminPanelForm extends Form
$this->out->dropdown('timezone', _('Default timezone'),
$timezones, _('Default timezone for the site; usually UTC.'),
true, $this->value('timezone'));
+
+ $this->out->dropdown('language', _('Language'),
+ get_nice_language_list(), _('Default site language'),
+ false, $this->value('language'));
}
/**