ApplicationBootstrap: Use L10n locales in `getLocaleDir()` if available

This commit is contained in:
Johannes Meyer 2020-05-11 17:05:23 +02:00
parent 335dde7b68
commit c40d134ea5
1 changed files with 17 additions and 1 deletions

View File

@ -75,6 +75,13 @@ abstract class ApplicationBootstrap
*/ */
protected $configDir; protected $configDir;
/**
* Locale directory
*
* @var string
*/
protected $localeDir;
/** /**
* Common storage directory * Common storage directory
* *
@ -663,7 +670,16 @@ abstract class ApplicationBootstrap
*/ */
public function getLocaleDir() 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;
} }
/** /**