]> source.dussan.org Git - nextcloud-server.git/commitdiff
feat(l10n): Allow to force language with a query parameter
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 8 Oct 2024 12:44:03 +0000 (14:44 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 8 Oct 2024 12:44:03 +0000 (14:44 +0200)
This will be used by support application to always generate the support
 report in english. It may also be used to debug a language, or to
 temporarily show a page in an other language to take a screenshot or to
 share your screen with someone speaking another language.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/L10N/Factory.php

index ecf7381ba99cabdf4889d06f4d7182c32e04e59c..dc65714c11bf0bc9cde2debd5e4478242ac71e9c 100644 (file)
@@ -98,7 +98,7 @@ class Factory implements IFactory {
                                $lang = str_replace(['\0', '/', '\\', '..'], '', $lang);
                        }
 
-                       $forceLang = $this->config->getSystemValue('force_language', false);
+                       $forceLang = $this->request->getParam('forceLanguage') ?? $this->config->getSystemValue('force_language', false);
                        if (is_string($forceLang)) {
                                $lang = $forceLang;
                        }