diff --git a/include/class.client.php b/include/class.client.php index 5e2485ed0f8f0bcef04f2570c43710954f6d6643..152c6dee52793ef52241899b7335ca69741a6cf3 100644 --- a/include/class.client.php +++ b/include/class.client.php @@ -375,6 +375,10 @@ class ClientAccount extends UserAccount { $this->set('timezone_id', $vars['timezone_id']); $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']) { $this->set('backend', $vars['backend']); diff --git a/include/client/profile.inc.php b/include/client/profile.inc.php index f500e1cb935e0a05a835793c3c22a9fc44b37a4e..89fa70a095d56c8f68c54d2ae9beb0d23648e299 100644 --- a/include/client/profile.inc.php +++ b/include/client/profile.inc.php @@ -48,6 +48,24 @@ if ($acct = $thisclient->getAccount()) { <strong><?php echo Format::date($cfg->getDateTimeFormat(),Misc::gmtime(),$info['tz_offset'],$info['dst']); ?></strong>)</em> </td> </tr> + <tr> + <td width="180"> + <?php echo __('Preferred Language'); ?>: + </td> + <td> + <?php + $langs = Internationalization::availableLanguages(); ?> + <select name="lang"> + <option value="">— <?php echo __('Use Browser Preference'); ?> —</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"> <?php echo $errors['lang']; ?></span> + </td> + </tr> <?php if ($acct->isPasswdResetEnabled()) { ?> <tr> <td colspan=2">