if (count($locales) > 1) { ?> <p> <label><?php _e('Language'); ?> <br /> <select name="locale" id="user_language"> <?php foreach ($locales as $locale) { ?> <option value="<?php echo $locale['pk_c_code']; ?> " <?php if (osc_admin_language() == $locale['pk_c_code']) { echo 'selected="selected"'; } ?> ><?php echo $locale['s_short_name']; ?> </option> <?php } ?> </select> </label> </p> <?php } else {
/** * Get the actual locale of the admin. * * You get the right locale code. If an admin is using the website in another language different of the default one, or * the admin uses the default one, you'll get it. * * @return string OSCLocale Code */ function osc_current_admin_locale() { if (Session::newInstance()->_get('adminLocale') != '') { return Session::newInstance()->_get('adminLocale'); } return osc_admin_language(); }