ApplicationBootstrap: Use L10n locales in `getLocaleDir()` if available
This commit is contained in:
parent
335dde7b68
commit
c40d134ea5
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue