translation: Always use the correct path to the Icinga library in the translation helper

refs #9615
This commit is contained in:
Eric Lippmann 2015-07-31 11:30:26 +02:00
parent cc0dfedb31
commit 834017f6e5

View File

@ -79,6 +79,13 @@ class GettextTranslationHelper
*/ */
private $moduleDir; private $moduleDir;
/**
* Path to the Icinga library
*
* @var string
*/
protected $libDir;
/** /**
* The path to the file catalog * The path to the file catalog
* *
@ -110,6 +117,7 @@ class GettextTranslationHelper
{ {
$this->moduleMgr = $bootstrap->getModuleManager()->loadEnabledModules(); $this->moduleMgr = $bootstrap->getModuleManager()->loadEnabledModules();
$this->appDir = $bootstrap->getApplicationDir(); $this->appDir = $bootstrap->getApplicationDir();
$this->libDir = $bootstrap->getLibraryDir('Icinga');
$this->locale = $locale; $this->locale = $locale;
} }
@ -396,7 +404,7 @@ class GettextTranslationHelper
$this->getSourceFileNames($this->moduleDir, $catalog); $this->getSourceFileNames($this->moduleDir, $catalog);
} else { } else {
$this->getSourceFileNames($this->appDir, $catalog); $this->getSourceFileNames($this->appDir, $catalog);
$this->getSourceFileNames(realpath($this->appDir . '/../library/Icinga'), $catalog); $this->getSourceFileNames($this->libDir, $catalog);
} }
} catch (Exception $error) { } catch (Exception $error) {
throw $error; throw $error;