Skip to content
Snippets Groups Projects
Commit db8dba3f authored by Jared Hancock's avatar Jared Hancock
Browse files

i18n: Clients can elect a language preference

parent 17e2dcca
No related branches found
No related tags found
No related merge requests found
...@@ -375,6 +375,10 @@ class ClientAccount extends UserAccount { ...@@ -375,6 +375,10 @@ class ClientAccount extends UserAccount {
$this->set('timezone_id', $vars['timezone_id']); $this->set('timezone_id', $vars['timezone_id']);
$this->set('dst', isset($vars['dst']) ? 1 : 0); $this->set('dst', isset($vars['dst']) ? 1 : 0);
// Change language
$this->set('lang', $vars['lang'] ?: null);
$_SESSION['client:lang'] = null;
TextDomain::configureForUser($this);
if ($vars['backend']) { if ($vars['backend']) {
$this->set('backend', $vars['backend']); $this->set('backend', $vars['backend']);
......
...@@ -48,6 +48,24 @@ if ($acct = $thisclient->getAccount()) { ...@@ -48,6 +48,24 @@ if ($acct = $thisclient->getAccount()) {
<strong><?php echo Format::date($cfg->getDateTimeFormat(),Misc::gmtime(),$info['tz_offset'],$info['dst']); ?></strong>)</em> <strong><?php echo Format::date($cfg->getDateTimeFormat(),Misc::gmtime(),$info['tz_offset'],$info['dst']); ?></strong>)</em>
</td> </td>
</tr> </tr>
<tr>
<td width="180">
<?php echo __('Preferred Language'); ?>:
</td>
<td>
<?php
$langs = Internationalization::availableLanguages(); ?>
<select name="lang">
<option value="">&mdash; <?php echo __('Use Browser Preference'); ?> &mdash;</option>
<?php foreach($langs as $l) {
$selected = ($info['lang'] == $l['code']) ? 'selected="selected"' : ''; ?>
<option value="<?php echo $l['code']; ?>" <?php echo $selected;
?>><?php echo Internationalization::getLanguageDescription($l['code']); ?></option>
<?php } ?>
</select>
<span class="error">&nbsp;<?php echo $errors['lang']; ?></span>
</td>
</tr>
<?php if ($acct->isPasswdResetEnabled()) { ?> <?php if ($acct->isPasswdResetEnabled()) { ?>
<tr> <tr>
<td colspan=2"> <td colspan=2">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment