Browse Source

feat(l10n): Allow to force language with a query parameter

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>
pull/48613/head
Côme Chilliet 1 year ago
parent
commit
1b8949ebac
No known key found for this signature in database GPG Key ID: A3E2F658B28C760A
  1. 2
      lib/private/L10N/Factory.php

2
lib/private/L10N/Factory.php

@ -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;
}

Loading…
Cancel
Save