diff options
author | Misha M.-Kupriyanov <kupriyanov@strato.de> | 2024-03-15 10:40:54 +0100 |
---|---|---|
committer | Mikhailo Matiyenko-Kupriyanov <145785698+printminion-co@users.noreply.github.com> | 2024-07-01 09:34:11 +0200 |
commit | aceb4d776c48dbe46cf066c4688a190b153ed046 (patch) | |
tree | 94d0cd9dbb23bd42bba4b9de3022933a301e74c1 /lib/private/L10N | |
parent | d5b7525e1fd2aa03f403a43a6b5b80b9e44e01da (diff) | |
download | nextcloud-server-aceb4d776c48dbe46cf066c4688a190b153ed046.tar.gz nextcloud-server-aceb4d776c48dbe46cf066c4688a190b153ed046.zip |
feat: reduce available languages per config value "reduce_to_languages"
Example: restrict to en, de, es, fr, it' languages
./occ config:system:set reduce_to_languages 0 --value en
./occ config:system:set reduce_to_languages 1 --value de
./occ config:system:set reduce_to_languages 2 --value es
./occ config:system:set reduce_to_languages 3 --value fr
./occ config:system:set reduce_to_languages 4 --value it
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Diffstat (limited to 'lib/private/L10N')
-rw-r--r-- | lib/private/L10N/Factory.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index 1825719fb75..6b6dc5d3b40 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -576,6 +576,10 @@ class Factory implements IFactory { } $languageCodes = $this->findAvailableLanguages(); + $reduceToLanguages = $this->config->getSystemValue('reduce_to_languages', []); + if (!empty($reduceToLanguages)) { + $languageCodes = array_intersect($languageCodes, $reduceToLanguages); + } $commonLanguages = []; $otherLanguages = []; |