change.php 399 B

123456789101112131415161718
  1. <?php
  2. $new_lang_id = get_input("lang_id");
  3. $installed = get_installed_translations();
  4. if (!empty($new_lang_id) && array_key_exists($new_lang_id, $installed)) {
  5. if ($user = elgg_get_logged_in_user_entity()) {
  6. $user->language = $new_lang_id;
  7. $user->save();
  8. // let other plugins know we updated the language
  9. elgg_trigger_event("update", "language", $user);
  10. }
  11. }
  12. forward(REFERER);