From c40d134ea53a78e3742e1f669d7bcb756e56f94b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 11 May 2020 17:05:23 +0200 Subject: [PATCH] ApplicationBootstrap: Use L10n locales in `getLocaleDir()` if available --- .../Application/ApplicationBootstrap.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index be654f8f9..f3d8c086f 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -75,6 +75,13 @@ abstract class ApplicationBootstrap */ protected $configDir; + /** + * Locale directory + * + * @var string + */ + protected $localeDir; + /** * Common storage directory * @@ -663,7 +670,16 @@ abstract class ApplicationBootstrap */ public function getLocaleDir() { - return $this->getApplicationDir('locale'); + if ($this->localeDir === null) { + $L10nLocales = getenv('ICINGAWEB_LOCALEDIR') ?: '/usr/share/icinga-L10n/locale'; + if (file_exists($L10nLocales) && is_dir($L10nLocales)) { + $this->localeDir = $L10nLocales; + } else { + $this->localeDir = $this->getApplicationDir('locale'); + } + } + + return $this->localeDir; } /**