Skip to content

Commit b6a3a12

Browse files
st3inySebastianKrupinski
authored andcommitted
fix(l10n): do not consider user language when getting the generic one
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
1 parent 775d610 commit b6a3a12

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

lib/private/L10N/Factory.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -228,27 +228,7 @@ public function findGenericLanguage(?string $appId = null): string {
228228
return $defaultLanguage;
229229
}
230230

231-
// Step 3.1: Check if Nextcloud is already installed before we try to access user info
232-
if (!$this->config->getSystemValueBool('installed', false)) {
233-
return 'en';
234-
}
235-
// Step 3.2: Check the current user (if any) for their preferred language
236-
$user = $this->userSession->getUser();
237-
if ($user !== null) {
238-
$userLang = $this->config->getUserValue($user->getUID(), 'core', 'lang', null);
239-
if ($userLang !== null) {
240-
return $userLang;
241-
}
242-
}
243-
244-
// Step 4: Check the request headers
245-
try {
246-
return $this->getLanguageFromRequest($appId);
247-
} catch (LanguageNotFoundException $e) {
248-
// Ignore and continue
249-
}
250-
251-
// Step 5: fall back to English
231+
// Step 3: fall back to English
252232
return 'en';
253233
}
254234

0 commit comments

Comments
 (0)