Immediately changes the interface language if the active user changes their language
authorMatthias Schmidt <gravatronics@live.com>
Tue, 17 Jul 2012 16:22:51 +0000 (18:22 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 17 Jul 2012 16:22:51 +0000 (18:22 +0200)
wcfsetup/install/files/lib/data/user/UserAction.class.php

index 682e40c5d3e9682bef72b3f7d8fd3111fbfb8f35..58b532e2fad405bedc16100bc88e4a4e0a22c90e 100644 (file)
@@ -151,6 +151,18 @@ class UserAction extends AbstractDatabaseObjectAction {
        public function update() {
                if (isset($this->parameters['data'])) {
                        parent::update();
+                       
+                       if (isset($this->parameters['data']['languageID'])) {
+                               foreach ($this->objects as $object) {
+                                       if ($object->userID == WCF::getUser()->userID) {
+                                               if ($this->parameters['data']['languageID'] != WCF::getUser()->languageID) {
+                                                       WCF::setLanguage($this->parameters['data']['languageID']);
+                                               }
+                                               
+                                               break;
+                                       }
+                               }
+                       }
                }
                else {
                        if (!count($this->objects)) {