Browse Source

Fix API i18n (#2565)

Fix https://github.com/FreshRSS/FreshRSS/issues/2564
Alexandre Alapetite 6 years ago
parent
commit
b20fddc330
2 changed files with 6 additions and 0 deletions
  1. 3 0
      p/api/fever.php
  2. 3 0
      p/api/greader.php

+ 3 - 0
p/api/fever.php

@@ -165,9 +165,12 @@ class FeverAPI
 				$user_conf = get_user_configuration($username);
 				if ($user_conf != null && $feverKey === $user_conf->feverKey) {
 					FreshRSS_Context::$user_conf = $user_conf;
+					Minz_Translate::init(FreshRSS_Context::$user_conf->language);
 					$this->entryDAO = FreshRSS_Factory::createEntryDao();
 					$this->feedDAO = FreshRSS_Factory::createFeedDao();
 					return true;
+				} else {
+					Minz_Translate::init();
 				}
 				Minz_Log::error('Fever API: Reset API password for user: ' . $username, API_LOG);
 				Minz_Log::error('Fever API: Please reset your API password!');

+ 3 - 0
p/api/greader.php

@@ -916,6 +916,9 @@ $user = authorizationToUser();
 FreshRSS_Context::$user_conf = null;
 if ($user !== '') {
 	FreshRSS_Context::$user_conf = get_user_configuration($user);
+	Minz_Translate::init(FreshRSS_Context::$user_conf->language);
+} else {
+	Minz_Translate::init();
 }
 
 Minz_Session::_param('currentUser', $user);